Merge pull request #1857 from matrix-org/luke/fix-piwik-crash2

Fix Analytics to not import DEFAULTS, therefore avoiding NPE
This commit is contained in:
Luke Barnard 2018-04-26 14:44:13 +01:00 committed by GitHub
commit a17c6e10ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View file

@ -16,7 +16,7 @@
import { getCurrentLanguage, _t, _td } from './languageHandler';
import PlatformPeg from './PlatformPeg';
import SdkConfig, { DEFAULTS } from './SdkConfig';
import SdkConfig from './SdkConfig';
import Modal from './Modal';
import sdk from './index';
@ -199,8 +199,8 @@ class Analytics {
const config = SdkConfig.get();
if (!config.piwik) return;
const whitelistedHSUrls = config.piwik.whitelistedHSUrls || DEFAULTS.piwik.whitelistedHSUrls;
const whitelistedISUrls = config.piwik.whitelistedISUrls || DEFAULTS.piwik.whitelistedISUrls;
const whitelistedHSUrls = config.piwik.whitelistedHSUrls;
const whitelistedISUrls = config.piwik.whitelistedISUrls;
this._setVisitVariable('User Type', isGuest ? 'Guest' : 'Logged In');
this._setVisitVariable('Homeserver URL', whitelistRedact(whitelistedHSUrls, homeserverUrl));

View file

@ -45,4 +45,3 @@ class SdkConfig {
}
module.exports = SdkConfig;
module.exports.DEFAULTS = DEFAULTS;