mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 22:32:06 +01:00
fix: Prevent attempt to construct invalid address
When no join was properly registered, a nickname will not be defined. In that case, attempting to construct the from address for the 'leave' presence stanza will result in: java.lang.IllegalArgumentException: The Resourcepart must not be null This commit prevents that, by verifying that the nickname is non-null, before sending that stanza.
This commit is contained in:
parent
b80cc795e3
commit
03a267a925
1 changed files with 4 additions and 0 deletions
|
@ -756,6 +756,10 @@ public class MultiUserChat {
|
||||||
// throw.
|
// throw.
|
||||||
userHasLeft();
|
userHasLeft();
|
||||||
|
|
||||||
|
if (nickname == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// We leave a room by sending a presence packet where the "to"
|
// We leave a room by sending a presence packet where the "to"
|
||||||
// field is in the form "roomName@service/nickname"
|
// field is in the form "roomName@service/nickname"
|
||||||
Presence leavePresence = new Presence(Presence.Type.unavailable);
|
Presence leavePresence = new Presence(Presence.Type.unavailable);
|
||||||
|
|
Loading…
Reference in a new issue