Fix some NPEs in jabber provider and fixing build.

cusax-fix
Damian Minkov 16 years ago
parent 02710105f1
commit 0eaeb3900d

@ -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;

@ -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;

@ -786,6 +786,7 @@ else if(evt.getNewState() == RegistrationState.UNREGISTERED
fireProviderStatusChangeEvent(oldStatus, currentStatus);
ssContactList.cleanup();
subscribtionPacketListener = null;
if(parentProvider.getConnection() != null &&
parentProvider.getConnection().getRoster() != null)

@ -266,8 +266,11 @@ else if(evt.getNewState() == RegistrationState.UNREGISTERED
smackChatManagerListener = null;
messageEventManager.destroy();
messageEventManager = null;
if(messageEventManager != null)
{
messageEventManager.destroy();
messageEventManager = null;
}
}
}
}

@ -696,7 +696,9 @@ void cleanup()
imageRetriever = null;
}
this.roster.removeRosterListener(rosterChangeListener);
if(this.roster != null)
this.roster.removeRosterListener(rosterChangeListener);
this.rosterChangeListener = null;
this.roster = null;
}

@ -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 String getGroupName()
* 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 String toString()
* containing non persistent contacts.
* @return true if the contact group is persistent and false otherwise.
*/
@Override
public boolean isPersistent()
{
return false;

@ -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 String getAddress()
* @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 String getDisplayName()
*
* @return a string representation of this contact.
*/
@Override
public String toString()
{
StringBuffer buff = new StringBuffer("VolatileJabberContact[ id=");
@ -71,9 +74,9 @@ public String toString()
* containing non persistent contacts.
* @return true if the contact group is persistent and false otherwise.
*/
@Override
public boolean isPersistent()
{
return false;
}
}

Loading…
Cancel
Save