From a16c068313474d4846189f86c6e76361a966b6c4 Mon Sep 17 00:00:00 2001 From: JC Brand Date: Tue, 9 Jul 2019 13:45:34 +0200 Subject: [PATCH] Bugfix. Handle `null` passed in as `attrs` to `api.rooms.create` --- src/headless/converse-muc.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/headless/converse-muc.js b/src/headless/converse-muc.js index c2666822c..8eea2725d 100644 --- a/src/headless/converse-muc.js +++ b/src/headless/converse-muc.js @@ -2094,12 +2094,8 @@ converse.plugins.add('converse-muc', { * JIDs of the chatroom(s) to create * @param {object} [attrs] attrs The room attributes */ - create (jids, attrs) { - if (_.isString(attrs)) { - attrs = {'nick': attrs}; - } else if (_.isUndefined(attrs)) { - attrs = {}; - } + create (jids, attrs={}) { + attrs = _.isString(attrs) ? {'nick': attrs} : (attrs || {}); if (_.isUndefined(attrs.maximize)) { attrs.maximize = false; }