mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2024-11-17 02:48:31 -07:00
Fix crash on empty advanced section. https://github.com/Koenkk/zigbee2mqtt/issues/1237
This commit is contained in:
parent
9f31cd86a3
commit
79d11e295b
@ -70,7 +70,17 @@ const defaults = {
|
||||
|
||||
let _settings;
|
||||
|
||||
const getSettings = () => _settings||(_settings = read());
|
||||
function getSettings() {
|
||||
if (!_settings) {
|
||||
_settings = read();
|
||||
}
|
||||
|
||||
if (_settings.hasOwnProperty('advanced') && !_settings.advanced) {
|
||||
delete _settings.advanced;
|
||||
}
|
||||
|
||||
return _settings;
|
||||
}
|
||||
|
||||
function writeRead() {
|
||||
write();
|
||||
|
Loading…
Reference in New Issue
Block a user