From a05dafc3003d9133549d4d0e43c1a04b5734588a Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 12 Feb 2020 01:58:21 +0000 Subject: [PATCH] Check for null config settings a bit safer Fixes https://github.com/vector-im/riot-web/issues/12254 --- src/settings/handlers/ConfigSettingsHandler.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/settings/handlers/ConfigSettingsHandler.js b/src/settings/handlers/ConfigSettingsHandler.js index a54ad1cef6..3b5b4b626e 100644 --- a/src/settings/handlers/ConfigSettingsHandler.js +++ b/src/settings/handlers/ConfigSettingsHandler.js @@ -17,6 +17,7 @@ limitations under the License. import SettingsHandler from "./SettingsHandler"; import SdkConfig from "../../SdkConfig"; +import {isNullOrUndefined} from "matrix-js-sdk/src/utils"; /** * Gets and sets settings at the "config" level. This handler does not make use of the @@ -32,7 +33,7 @@ export default class ConfigSettingsHandler extends SettingsHandler { } const settingsConfig = config["settingDefaults"]; - if (!settingsConfig || !settingsConfig[settingName]) return null; + if (!settingsConfig || isNullOrUndefined(settingsConfig[settingName])) return null; return settingsConfig[settingName]; }