Composer: Only process mentions if they exist, fixes #133
This commit is contained in:
parent
9871d0f37c
commit
374e985e37
1 changed files with 2 additions and 1 deletions
|
@ -191,7 +191,8 @@ const expandMentions = status => {
|
|||
const fragment = domParser.parseFromString(status.get('content'), 'text/html').documentElement;
|
||||
|
||||
status.get('mentions').forEach(mention => {
|
||||
fragment.querySelector(`a[href="${mention.get('url')}"]`).textContent = `@${mention.get('acct')}`;
|
||||
const node = fragment.querySelector(`a[href="${mention.get('url')}"]`);
|
||||
if (node) node.textContent = `@${mention.get('acct')}`;
|
||||
});
|
||||
|
||||
return fragment.innerHTML;
|
||||
|
|
Loading…
Reference in a new issue