Check for null config settings a bit safer
Fixes https://github.com/vector-im/riot-web/issues/12254
This commit is contained in:
parent
720450f372
commit
a05dafc300
1 changed files with 2 additions and 1 deletions
|
@ -17,6 +17,7 @@ limitations under the License.
|
||||||
|
|
||||||
import SettingsHandler from "./SettingsHandler";
|
import SettingsHandler from "./SettingsHandler";
|
||||||
import SdkConfig from "../../SdkConfig";
|
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
|
* 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"];
|
const settingsConfig = config["settingDefaults"];
|
||||||
if (!settingsConfig || !settingsConfig[settingName]) return null;
|
if (!settingsConfig || isNullOrUndefined(settingsConfig[settingName])) return null;
|
||||||
return settingsConfig[settingName];
|
return settingsConfig[settingName];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue