浏览代码

core: use _.get since connection might not be set up yet

JC Brand 5 年之前
父节点
当前提交
487f1b5281
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/headless/converse-core.js

+ 1 - 1
src/headless/converse-core.js

@@ -490,7 +490,7 @@ function connect (credentials) {
             BOSH_WAIT
             BOSH_WAIT
         );
         );
     } else if (_converse.authentication === _converse.LOGIN) {
     } else if (_converse.authentication === _converse.LOGIN) {
-        const password = credentials ? credentials.password : (_converse.connection.pass || _converse.password);
+        const password = credentials ? credentials.password : (_.get(_converse.connection, 'pass') || _converse.password);
         if (!password) {
         if (!password) {
             if (_converse.auto_login) {
             if (_converse.auto_login) {
                 throw new Error("autoLogin: If you use auto_login and "+
                 throw new Error("autoLogin: If you use auto_login and "+