Fixes #1043 Parsing of bookmarks fail with missing nick element.
This commit is contained in:
parent
ce849aaffc
commit
6a12a96e85
@ -444,7 +444,7 @@
|
|||||||
'name': 'Another room',
|
'name': 'Another room',
|
||||||
'autojoin': 'false',
|
'autojoin': 'false',
|
||||||
'jid': 'another@conference.shakespeare.lit'
|
'jid': 'another@conference.shakespeare.lit'
|
||||||
}).c('nick').t('JC').up().up();
|
}); // Purposefully exclude the <nick> element to test #1043
|
||||||
_converse.connection._dataRecv(test_utils.createRequest(stanza));
|
_converse.connection._dataRecv(test_utils.createRequest(stanza));
|
||||||
expect(_converse.bookmarks.models.length).toBe(2);
|
expect(_converse.bookmarks.models.length).toBe(2);
|
||||||
expect(_converse.bookmarks.findWhere({'jid': 'theplay@conference.shakespeare.lit'}).get('autojoin')).toBe(true);
|
expect(_converse.bookmarks.findWhere({'jid': 'theplay@conference.shakespeare.lit'}).get('autojoin')).toBe(true);
|
||||||
|
@ -382,7 +382,7 @@
|
|||||||
'jid': bookmark.getAttribute('jid'),
|
'jid': bookmark.getAttribute('jid'),
|
||||||
'name': bookmark.getAttribute('name'),
|
'name': bookmark.getAttribute('name'),
|
||||||
'autojoin': bookmark.getAttribute('autojoin') === 'true',
|
'autojoin': bookmark.getAttribute('autojoin') === 'true',
|
||||||
'nick': bookmark.querySelector('nick').textContent
|
'nick': _.get(bookmark.querySelector('nick'), 'textContent')
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user