aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamian Minkov <damencho@jitsi.org>2010-07-09 09:07:32 +0000
committerDamian Minkov <damencho@jitsi.org>2010-07-09 09:07:32 +0000
commit0eaeb3900d74fe62e468bbcea040000e945ff135 (patch)
tree32d1deeaa077e5224cb1750888162eb2bb939bc8
parent02710105f1d8b3625a31ad853903d316c9e2d468 (diff)
downloadjitsi-0eaeb3900d74fe62e468bbcea040000e945ff135.zip
jitsi-0eaeb3900d74fe62e468bbcea040000e945ff135.tar.gz
jitsi-0eaeb3900d74fe62e468bbcea040000e945ff135.tar.bz2
Fix some NPEs in jabber provider and fixing build.
-rw-r--r--src/net/java/sip/communicator/impl/protocol/jabber/ContactGroupJabberImpl.java5
-rw-r--r--src/net/java/sip/communicator/impl/protocol/jabber/ContactJabberImpl.java5
-rw-r--r--src/net/java/sip/communicator/impl/protocol/jabber/OperationSetPersistentPresenceJabberImpl.java1
-rw-r--r--src/net/java/sip/communicator/impl/protocol/jabber/OperationSetTypingNotificationsJabberImpl.java7
-rw-r--r--src/net/java/sip/communicator/impl/protocol/jabber/ServerStoredContactListJabberImpl.java4
-rw-r--r--src/net/java/sip/communicator/impl/protocol/jabber/VolatileContactGroupJabberImpl.java3
-rw-r--r--src/net/java/sip/communicator/impl/protocol/jabber/VolatileContactJabberImpl.java5
7 files changed, 24 insertions, 6 deletions
diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/ContactGroupJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/ContactGroupJabberImpl.java
index dafa380..99c993a 100644
--- a/src/net/java/sip/communicator/impl/protocol/jabber/ContactGroupJabberImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/jabber/ContactGroupJabberImpl.java
@@ -96,7 +96,10 @@ public class ContactGroupJabberImpl
ServerStoredContactListJabberImpl ssclCallback,
boolean isResolved)
{
- this.id = rosterGroup.getName();
+ // rosterGroup can be null when creating volatile contact group
+ if(rosterGroup != null)
+ this.id = rosterGroup.getName();
+
this.isResolved = isResolved;
this.ssclCallback = ssclCallback;
diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/ContactJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/ContactJabberImpl.java
index c431b01..6f3bb3f 100644
--- a/src/net/java/sip/communicator/impl/protocol/jabber/ContactJabberImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/jabber/ContactJabberImpl.java
@@ -82,7 +82,10 @@ public class ContactJabberImpl
boolean isPersistent,
boolean isResolved)
{
- this.jid = rosterEntry.getUser();
+ // rosterEntry can be null when creating volatile contact
+ if(rosterEntry != null)
+ this.jid = rosterEntry.getUser();
+
this.ssclCallback = ssclCallback;
this.isPersistent = isPersistent;
this.isResolved = isResolved;
diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetPersistentPresenceJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetPersistentPresenceJabberImpl.java
index 088e138..815bfc8 100644
--- a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetPersistentPresenceJabberImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetPersistentPresenceJabberImpl.java
@@ -786,6 +786,7 @@ public class OperationSetPersistentPresenceJabberImpl
fireProviderStatusChangeEvent(oldStatus, currentStatus);
ssContactList.cleanup();
+ subscribtionPacketListener = null;
if(parentProvider.getConnection() != null &&
parentProvider.getConnection().getRoster() != null)
diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetTypingNotificationsJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetTypingNotificationsJabberImpl.java
index 009dcb4..faec8ad 100644
--- a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetTypingNotificationsJabberImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetTypingNotificationsJabberImpl.java
@@ -266,8 +266,11 @@ public class OperationSetTypingNotificationsJabberImpl
smackChatManagerListener = null;
- messageEventManager.destroy();
- messageEventManager = null;
+ if(messageEventManager != null)
+ {
+ messageEventManager.destroy();
+ messageEventManager = null;
+ }
}
}
}
diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/ServerStoredContactListJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/ServerStoredContactListJabberImpl.java
index ae704e1..0a0e11f 100644
--- a/src/net/java/sip/communicator/impl/protocol/jabber/ServerStoredContactListJabberImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/jabber/ServerStoredContactListJabberImpl.java
@@ -696,7 +696,9 @@ public class ServerStoredContactListJabberImpl
imageRetriever = null;
}
- this.roster.removeRosterListener(rosterChangeListener);
+ if(this.roster != null)
+ this.roster.removeRosterListener(rosterChangeListener);
+
this.rosterChangeListener = null;
this.roster = null;
}
diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/VolatileContactGroupJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/VolatileContactGroupJabberImpl.java
index 5312817..d3e13c8 100644
--- a/src/net/java/sip/communicator/impl/protocol/jabber/VolatileContactGroupJabberImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/jabber/VolatileContactGroupJabberImpl.java
@@ -44,6 +44,7 @@ public class VolatileContactGroupJabberImpl
* Returns the name of this group.
* @return a String containing the name of this group.
*/
+ @Override
public String getGroupName()
{
return contactGroupName;
@@ -54,6 +55,7 @@ public class VolatileContactGroupJabberImpl
* JabberGroup.GroupName[size]{ buddy1.toString(), buddy2.toString(), ...}.
* @return a String representation of the object.
*/
+ @Override
public String toString()
{
StringBuffer buff = new StringBuffer("VolatileJabberGroup.");
@@ -77,6 +79,7 @@ public class VolatileContactGroupJabberImpl
* containing non persistent contacts.
* @return true if the contact group is persistent and false otherwise.
*/
+ @Override
public boolean isPersistent()
{
return false;
diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/VolatileContactJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/VolatileContactJabberImpl.java
index 2b4afdf..0eca00c 100644
--- a/src/net/java/sip/communicator/impl/protocol/jabber/VolatileContactJabberImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/jabber/VolatileContactJabberImpl.java
@@ -34,6 +34,7 @@ public class VolatileContactJabberImpl
* Returns the Jabber Userid of this contact
* @return the Jabber Userid of this contact
*/
+ @Override
public String getAddress()
{
return contactId;
@@ -46,6 +47,7 @@ public class VolatileContactJabberImpl
* @return a String that can be used for referring to this contact when
* interacting with the user.
*/
+ @Override
public String getDisplayName()
{
return contactId;
@@ -57,6 +59,7 @@ public class VolatileContactJabberImpl
*
* @return a string representation of this contact.
*/
+ @Override
public String toString()
{
StringBuffer buff = new StringBuffer("VolatileJabberContact[ id=");
@@ -71,9 +74,9 @@ public class VolatileContactJabberImpl
* containing non persistent contacts.
* @return true if the contact group is persistent and false otherwise.
*/
+ @Override
public boolean isPersistent()
{
return false;
}
-
}