Fix up try/catch block in invalid URL handling

lolsob-rspec
Thibaut Girka 2019-08-06 12:56:19 +02:00 committed by ThibG
parent e6272f1af0
commit bd0a478252
1 changed files with 3 additions and 3 deletions

View File

@ -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');
} }
} }