There’s a possible NPE when parsing RosterPackets in the following code:
// Set type.
String subscription = parser.getAttributeValue("", “subscription”);
RosterPacket.ItemType type = RosterPacket.ItemType.valueOf(subscription);
item.setItemType(type);
According to the namespace “** jabber:iq:roster”** , the “subscription” attribute is optional, which will lead to parser.getAttributeValue returning null, hence throwing NPE when trying to get “RosterPacket.ItemType.valueOf(subscription);”
I’m sorry if this is a duplicated issue, but I couldn’t find any previous thread regarding it… this is also my first post