Moved error checking to utils, where parse is

This commit is contained in:
Matt Smith 2020-07-10 10:01:15 -05:00
parent ebaa69a15b
commit 57649f31c4
2 changed files with 11 additions and 8 deletions

View File

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

View File

@ -333,11 +333,9 @@ export class CipherService implements CipherServiceAbstraction {
this.settingsService.getEquivalentDomains().then((eqDomains: any[][]) => { this.settingsService.getEquivalentDomains().then((eqDomains: any[][]) => {
let matches: any[] = []; let matches: any[] = [];
eqDomains.forEach((eqDomain) => { eqDomains.forEach((eqDomain) => {
try {
if (eqDomain.length && eqDomain.indexOf(domain) >= 0) { if (eqDomain.length && eqDomain.indexOf(domain) >= 0) {
matches = matches.concat(eqDomain); matches = matches.concat(eqDomain);
} }
} catch {}
}); });
if (!matches.length) { if (!matches.length) {