Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException + fix #35

Open
fbernhard opened this issue Jan 4, 2013 · 2 comments
Open

NullPointerException + fix #35

fbernhard opened this issue Jan 4, 2013 · 2 comments

Comments

@fbernhard
Copy link

Hi there

I have encountered a NullPointerException in com.calclab.emite.im.roster.XmppRosterImpl: "presence.getShow()" can return null.

The following fixes it:

index 2839d03..f867946 100644
--- a/src/main/java/com/calclab/emite/im/roster/XmppRosterImpl.java
+++ b/src/main/java/com/calclab/emite/im/roster/XmppRosterImpl.java
@@ -102,7 +102,8 @@ public final class XmppRosterImpl implements XmppRoster, SessionStatusChangedEve
}
}

  •                   if (!presence.getShow().equals(item.getShow())) {
    
  •                   if (presence.getShow() != null && !presence.getShow().equals(item.getShow())
    
  •                                   || presence.getShow() == null && item.getShow() != null) {
                            hasChanged = true;
                            item.setShow(presence.getShow());
                    }
    
@ashward
Copy link
Member

ashward commented Feb 5, 2013

Thanks for that. Looks sensible. I'll add that patch in :)

@ghost
Copy link

ghost commented Mar 20, 2013

can you add this fix ... i have got this issue class: XmppRosterImpl line 107 code:
if (!presence.getShow().equals(item.getShow())) {
hasChanged = true;
item.setShow(presence.getShow());
}
i have got null pointer exception because prosence.getShow == null and item.getShow() == null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants