Commit 7dc0b7bb authored by JC Brand's avatar JC Brand

Handle case where we don't have the occupant

It can now happen because we also auto-complete for nicks based on
messages in the chat
parent 5fe23f47
......@@ -1386,8 +1386,12 @@ converse.plugins.add('converse-muc-views', {
return false;
}
const reason = args.split(nick_or_jid, 2)[1].trim();
// We're guaranteed to have an occupant due to getNickOrJIDFromCommandArgs
const occupant = this.model.getOccupant(nick_or_jid);
if (!occupant) {
this.showErrorMessage(__("Couldn't find a participant with that nickname or JID. They might have left the groupchat."));
return;
}
const attrs = {
'jid': occupant.get('jid'),
'reason': reason
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment