aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java
diff options
context:
space:
mode:
authorDanny van Heumen <danny@dannyvanheumen.nl>2014-11-02 17:41:16 +0100
committerDanny van Heumen <danny@dannyvanheumen.nl>2014-11-02 18:10:03 +0100
commit42cd6f74ba3ed45acd9c8ea07d21fc9e854c66e7 (patch)
treefa16bd7c9faf7576f7f319145baa3796fec43abe /src/net/java
parentb696de057f4a80de65400f6a0c2279d23798f778 (diff)
downloadjitsi-42cd6f74ba3ed45acd9c8ea07d21fc9e854c66e7.zip
jitsi-42cd6f74ba3ed45acd9c8ea07d21fc9e854c66e7.tar.gz
jitsi-42cd6f74ba3ed45acd9c8ea07d21fc9e854c66e7.tar.bz2
Fix NPE: Don't continue if chat room wrapper is null. (+ updated
documentation)
Diffstat (limited to 'src/net/java')
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomTableDialog.java8
-rw-r--r--src/net/java/sip/communicator/impl/muc/MUCServiceImpl.java3
-rw-r--r--src/net/java/sip/communicator/service/muc/MUCService.java3
3 files changed, 12 insertions, 2 deletions
diff --git a/src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomTableDialog.java b/src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomTableDialog.java
index ac58e38..adec0cc 100644
--- a/src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomTableDialog.java
+++ b/src/net/java/sip/communicator/impl/gui/main/chatroomslist/ChatRoomTableDialog.java
@@ -396,6 +396,14 @@ public class ChatRoomTableDialog
false,
false);
+ if (chatRoomWrapper == null)
+ {
+ // In case the protocol failed to create a chat room, null
+ // is returned, so we can stop preparing the UI to open the
+ // (null) chat room.
+ return;
+ }
+
if(!chatRoomWrapper.isPersistent())
{
chatRoomWrapper.setPersistent(true);
diff --git a/src/net/java/sip/communicator/impl/muc/MUCServiceImpl.java b/src/net/java/sip/communicator/impl/muc/MUCServiceImpl.java
index ca20e38..6169b87 100644
--- a/src/net/java/sip/communicator/impl/muc/MUCServiceImpl.java
+++ b/src/net/java/sip/communicator/impl/muc/MUCServiceImpl.java
@@ -412,7 +412,8 @@ public class MUCServiceImpl
* @param join whether we should join the room after creating it.
* @param persistent whether the newly created room will be persistent.
* @param isPrivate whether the room will be private or public.
- * @return the <tt>ChatRoomWrapper</tt> corresponding to the created room
+ * @return the <tt>ChatRoomWrapper</tt> corresponding to the created room or
+ * <tt>null</tt> if the protocol fails to create the chat room.
*/
public ChatRoomWrapper createChatRoom(
String roomName,
diff --git a/src/net/java/sip/communicator/service/muc/MUCService.java b/src/net/java/sip/communicator/service/muc/MUCService.java
index 1fb75bf..7a3337d 100644
--- a/src/net/java/sip/communicator/service/muc/MUCService.java
+++ b/src/net/java/sip/communicator/service/muc/MUCService.java
@@ -169,7 +169,8 @@ public abstract class MUCService
* @param join whether we should join the room after creating it.
* @param persistent whether the newly created room will be persistent.
* @param isPrivate whether the room will be private or public.
- * @return the <tt>ChatRoomWrapper</tt> corresponding to the created room
+ * @return the <tt>ChatRoomWrapper</tt> corresponding to the created room or
+ * <tt>null</tt> if the protocol failed to create the chat room
*/
public abstract ChatRoomWrapper createChatRoom(String roomName,
ProtocolProviderService protocolProvider, Collection<String> contacts,