diff --git a/src/misc/utils.ts b/src/misc/utils.ts index e0b7041356..e9b8b4911d 100644 --- a/src/misc/utils.ts +++ b/src/misc/utils.ts @@ -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; diff --git a/src/services/cipher.service.ts b/src/services/cipher.service.ts index eaf1ec0f83..7b519a1a4f 100644 --- a/src/services/cipher.service.ts +++ b/src/services/cipher.service.ts @@ -333,11 +333,9 @@ export class CipherService implements CipherServiceAbstraction { this.settingsService.getEquivalentDomains().then((eqDomains: any[][]) => { let matches: any[] = []; eqDomains.forEach((eqDomain) => { - try { - if (eqDomain.length && eqDomain.indexOf(domain) >= 0) { - matches = matches.concat(eqDomain); - } - } catch {} + if (eqDomain.length && eqDomain.indexOf(domain) >= 0) { + matches = matches.concat(eqDomain); + } }); if (!matches.length) {