From d734a9ba6eddba9057f21dae4f7866a5cd619916 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Thu, 26 Apr 2018 13:41:43 +0100 Subject: [PATCH] Null check piwik config before using it to avoid crashing at login --- src/Analytics.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Analytics.js b/src/Analytics.js index 09689fff15..a95e6ee0e9 100644 --- a/src/Analytics.js +++ b/src/Analytics.js @@ -197,6 +197,8 @@ class Analytics { if (this.disabled) return; const config = SdkConfig.get(); + if (!config.piwik) return; + const whitelistedHSUrls = config.piwik.whitelistedHSUrls || DEFAULTS.piwik.whitelistedHSUrls; const whitelistedISUrls = config.piwik.whitelistedISUrls || DEFAULTS.piwik.whitelistedISUrls;