Merge pull request #123 from bitwarden/malformed-url-fix

Prevent malformed URLs from blocking the loading of the current tab
This commit is contained in:
Matt Smith 2020-07-13 09:02:28 -05:00 committed by GitHub
commit 7561f6dcb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -204,9 +204,14 @@ export class Utils {
} catch (e) { }
}
const domain = tldjs != null && tldjs.getDomain != null ? tldjs.getDomain(uriString) : null;
if (domain != null) {
return domain;
try {
const domain = tldjs != null && tldjs.getDomain != null ? tldjs.getDomain(uriString) : null;
if (domain != null) {
return domain;
}
} catch {
return null;
}
return null;