Null check piwik config before using it

to avoid crashing at login
pull/21833/head
Luke Barnard 2018-04-26 13:41:43 +01:00
parent 452bf0bd09
commit d734a9ba6e
1 changed files with 2 additions and 0 deletions

View File

@ -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;