From 29216f4f68975b0b989e60d1457803f28d630bcb Mon Sep 17 00:00:00 2001 From: Shivang Patel <30023891+shivangp76@users.noreply.github.com> Date: Mon, 21 Oct 2024 16:35:03 -0400 Subject: [PATCH] fix(config): Fix modifying array values, such as for dimensions (#999) --- src/editor/ConfigObj.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/editor/ConfigObj.js b/src/editor/ConfigObj.js index f7706b1ae..c6a8d69bd 100644 --- a/src/editor/ConfigObj.js +++ b/src/editor/ConfigObj.js @@ -444,8 +444,8 @@ export default class ConfigObj { extendOrAdd(this.curConfig, key, val) } else if (cfgCfg.allowInitialUserOverride === true) { extendOrAdd(this.defaultConfig, key, val) - } else if (this.defaultConfig[key] && typeof this.defaultConfig[key] === 'object') { - this.curConfig[key] = Array.isArray(this.defaultConfig[key]) ? [] : {} + } else if (this.defaultConfig[key] && typeof this.defaultConfig[key] === 'object' && !Array.isArray(this.defaultConfig[key])) { + this.curConfig[key] = {} this.curConfig[key] = mergeDeep(this.curConfig[key], val) } else { this.curConfig[key] = val