From 020520729cdeb81c29fb3ced39a76216cfb1a80f Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 24 Jan 2018 12:38:19 -0500 Subject: [PATCH] dont exist when bgMain is null --- src/scripts/analytics.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/scripts/analytics.ts b/src/scripts/analytics.ts index 53e8e10f26..df0f153bb7 100644 --- a/src/scripts/analytics.ts +++ b/src/scripts/analytics.ts @@ -20,17 +20,13 @@ export default class Analytics { } const bgMain = bgPage.bitwardenMain; - if (!bgMain) { - return; - } - - if (platformUtilsService == null) { + if (platformUtilsService == null && bgMain) { this.platformUtilsService = bgMain.platformUtilsService as PlatformUtilsService; } - if (storageService == null) { + if (storageService == null && bgMain) { this.storageService = bgMain.storageService as StorageService; } - if (appIdService == null) { + if (appIdService == null && bgMain) { this.appIdService = bgMain.appIdService as AppIdService; }