Project

General

Profile

Exception when processing IQ stanza

channa bandara
Added almost 4 years ago

Hi,

I am running Tigase Server 7.0.0 with MUC in cluster mode. The setup is just working fine, but when I check the tigase logs I found the following exception in some places.

AbstractComponent.processPacket()  SEVERE:   java.lang.RuntimeException: java.lang.NullPointerException when processing from=null, to=null, DATA=<iq to="ed5a54c9-f6d6-448a-a798-cac7356159dd@muc.im.ncs" xmlns="jabber:client" type="set" id="FD3EC2E3-649D-4CAA-B1F8-C500ADA4E0B9" from="6591272743@im.ncs/Onechat"><query xmlns="http://jabber.org/protocol/muc#admin"/></iq>, SIZE=223, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=NONE, TYPE=set

I went through Tigase 7.0.0 source code and found that since does not have any child items, the code throws NullPointerException in the following code segment.

class - tigase.muc.modules.ModeratorModule

method - protected void processSet(Packet element)

code

Element query = element.getElement().getChild("query");

  List<Element> items = query.getChildren();

  for (Element item : items) {

    checkItem(room, item, nickName, senderAffiliation, senderRole);

  }

query element does not have any children, so items is null therefore the for loop breaks.

Is this a bug or has this been fixed in the newer versions? Or is this an error due to bad IQ stanza sent? Thanks


Replies (1)

Added by Wojciech Kapcia TigaseTeam almost 4 years ago

While the specification doesn't mandate minimum number of item elements, sending such stanza doesn't make much sense. I've added appropriate handling of such situation.

    (1-1/1)