From f6850072ea2986ffdbb6883a3ecb14d6c3960353 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 30 Aug 2018 21:47:49 -0400 Subject: [PATCH] Fix !== null checks --- jslib | 2 +- src/background/runtime.background.ts | 4 ++-- src/services/browserStorage.service.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/jslib b/jslib index 82bf646a77..38c26d9649 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 82bf646a779f9075acdb801a582c80e8b3d43a40 +Subproject commit 38c26d9649f613e4f8987e4e4727a0e90a21233b diff --git a/src/background/runtime.background.ts b/src/background/runtime.background.ts index c305bb80c8..cb781c38a1 100644 --- a/src/background/runtime.background.ts +++ b/src/background/runtime.background.ts @@ -153,7 +153,7 @@ export default class RuntimeBackground { tab: msg.tab, details: msg.details, }], msg.sender === 'autofill_cmd'); - if (totpCode !== null) { + if (totpCode != null) { this.platformUtilsService.copyToClipboard(totpCode, { window: window }); } break; @@ -181,7 +181,7 @@ export default class RuntimeBackground { pageDetails: this.pageDetailsToAutoFill, }); - if (totpCode !== null) { + if (totpCode != null) { this.platformUtilsService.copyToClipboard(totpCode, { window: window }); } diff --git a/src/services/browserStorage.service.ts b/src/services/browserStorage.service.ts index af460b7366..b6c2c1fd5d 100644 --- a/src/services/browserStorage.service.ts +++ b/src/services/browserStorage.service.ts @@ -21,7 +21,7 @@ export default class BrowserStorageService implements StorageService { const json = this.safariStorageApi.getItem(key); if (json) { const obj = JSON.parse(json); - if (obj && (typeof obj[key] !== 'undefined') && obj[key] !== null) { + if (obj != null && obj[key] != null) { resolve(obj[key] as T); return; } @@ -31,7 +31,7 @@ export default class BrowserStorageService implements StorageService { } else { return new Promise((resolve) => { this.chromeStorageApi.get(key, (obj: any) => { - if (obj && (typeof obj[key] !== 'undefined') && obj[key] !== null) { + if (obj != null && obj[key] != null) { resolve(obj[key] as T); return; }