Commit d921242b authored by JC Brand's avatar JC Brand

Fix `TypeError: Cannot read property 'chatbox' of undefined`

parent bdb347b7
......@@ -147,6 +147,12 @@ const tpl_mention = (o) => html`<span class="mention">${o.mention}</span>`;
function addReferences (text, model) {
if (!model.collection) {
// This model doesn't belong to a collection anymore, so it must be
// have been removed in the meantime and can be ignored.
log.debug('addReferences: ignoring dangling model');
return;
}
const nick = model.collection.chatbox.get('nick');
model.get('references')?.forEach(ref => {
const mention = text.slice(ref.begin, ref.end);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment