diff --git a/src/browserbox.js b/src/browserbox.js index 666521fd..8b90f0b3 100644 --- a/src/browserbox.js +++ b/src/browserbox.js @@ -672,7 +672,7 @@ if (!item || !item.attributes || item.attributes.length < 3) { return; } - var branch = this._ensurePath(tree, (item.attributes[2].value || '').toString(), (item.attributes[1].value).toString()); + var branch = this._ensurePath(tree, (item.attributes[2].value || '').toString(), (item.attributes[1] ? item.attributes[1].value : '/').toString()); [].concat(item.attributes[0] || []).map(function(flag) { flag = (flag.value || '').toString(); if (!branch.flags || branch.flags.indexOf(flag) < 0) { diff --git a/test/unit/browserbox-test.js b/test/unit/browserbox-test.js index e32db64d..bbc924da 100644 --- a/test/unit/browserbox-test.js +++ b/test/unit/browserbox-test.js @@ -518,7 +518,9 @@ }); callback(null, { payload: { - LSUB: [false] + LSUB: [ + imapHandler.parser('* LSUB (\\NoInferiors) NIL "INBOX"') + ] } }, function() { done();