diff options
author | Danny van Heumen <danny@dannyvanheumen.nl> | 2014-11-02 17:41:16 +0100 |
---|---|---|
committer | Danny van Heumen <danny@dannyvanheumen.nl> | 2014-11-02 18:10:03 +0100 |
commit | 42cd6f74ba3ed45acd9c8ea07d21fc9e854c66e7 (patch) | |
tree | fa16bd7c9faf7576f7f319145baa3796fec43abe /src/net/java | |
parent | b696de057f4a80de65400f6a0c2279d23798f778 (diff) | |
download | jitsi-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')
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,
|