RosterEntry#getGroups throws an NullPointerException at line 117

Hi,

Im using RosterEntry and RosterGroup in JTree model to present the status of the users list. After closing the connection I get the following exception:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
        at org.jivesoftware.smack.RosterEntry.getGroups(RosterEntry.java:117)
        at org.jivesoftware.smack.RosterEntry.toString(RosterEntry.java:154)
        at javax.swing.JTree.convertValueToText(JTree.java:1563)
        at javax.swing.tree.DefaultTreeCellRenderer.getTreeCellRendererComponent(DefaultTreeCellRenderer.java:346)

I think that would do well to check for null’s before:

117:     for (RosterGroup group : this.connection.roster.getGroups()) {

Am I right, or should I rather look for bugs in my own code?

EDIT: Smack 3.1.0

This code has already been changed. Try a nightly build to see if you still have tihis problem.

I have used nightly build of Smack 3.2.0 Beta2. Now its seems to be ok. Thanks.