mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-12 14:16:12 +01:00
Fix up try/catch block in invalid URL handling
This commit is contained in:
parent
cbd75fe128
commit
3ea7a334d8
@ -116,9 +116,9 @@ export default class StatusContent extends React.PureComponent {
|
|||||||
link.insertAdjacentText('beforeend', ' ');
|
link.insertAdjacentText('beforeend', ' ');
|
||||||
link.insertAdjacentElement('beforeend', tag);
|
link.insertAdjacentElement('beforeend', tag);
|
||||||
}
|
}
|
||||||
} catch (TypeError) {
|
} catch (e) {
|
||||||
// Just to be safe
|
// The URL is invalid, remove the href just to be safe
|
||||||
if (tagLinks) link.removeAttribute('href');
|
if (tagLinks && e instanceof TypeError) link.removeAttribute('href');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user