fix: error saving config
Massimo Melina committed
Apr 13, 2022 at 23:09 UTC
aa18de68b0e753c0f3235e32256f2817dd1925d1
1 file changed
+1
-1
server/src/config.ts
+1
-1
@@ -120,7 +120,7 @@ export const saveConfigAsap = debounceAsync(async () => {
120
while (!started)
121
await wait(100)
122
const diff = objSameKeys(state, (v,k) =>
123
- JSON.stringify(v) === JSON.stringify(configProps[k].defaultValue) ? undefined : v)
123
+ JSON.stringify(v) === JSON.stringify(configProps[k]?.defaultValue) ? undefined : v)
124
let txt = yaml.stringify(diff, { lineWidth:1000 })
125
if (txt.trim() === '{}') // most users wouldn't understand
126
if (await promisify(exists)(path)) // if a file exists then empty it, else don't bother creating it