diff --git a/lib/Parser.js b/lib/Parser.js index 86a535f..388f5a8 100644 --- a/lib/Parser.js +++ b/lib/Parser.js @@ -201,12 +201,16 @@ Parser.prototype._resUntagged = function() { || type === 'search' || type === 'capability' || type === 'sort') { - if (m[5][0] === '(') - val = RE_LISTCONTENT.exec(m[5])[1].split(' '); - else - val = m[5].split(' '); - if (type === 'search' || type === 'sort') - val = val.map(function(v) { return parseInt(v, 10); }); + if (m[5]) { + if (m[5][0] === '(') + val = RE_LISTCONTENT.exec(m[5])[1].split(' '); + else + val = m[5].split(' '); + + if (type === 'search' || type === 'sort') + val = val.map(function(v) { return parseInt(v, 10); }); + } else + val = []; } else if (type === 'list' || type === 'lsub') val = parseBoxList(m[5], this._literals); else if (type === 'status')