Null is inviting you to join a groupchat-- from room.sendInvitation()

I keep getting the following error:

"null is inviting you to join a group chat—from room.sendInvitation method.

MultiUserChatService mucService = mucManager.getMultiUserChatServices().get(0);

MUCRoom room = mucService.getChatRoom(_roomName, jid);

room.addFirstOwner(_roomCreator);

room.unlock(room.getRole());

room.sendInvitation(jid, _roomName, room.getRole(), null);

This reflects the null in the invitation.

Now I also tried the follwoing:

room.sendInvitation(jid,_roomName,room.getOccupantByFullJID(jid), null);

This throws a null pointer exception probably because there isnt anyone in the room yet.

So how can I “spoof” the invitation as being from a user rather than from null?

Or how can I join a user(who would be the room owner) to the room so that I can make the invites appear as if they are from the roomOwner?

Thanks in advance!

1 Like