From 15b4bcdf04db86c655ae16d4832ae2a8f0e55829 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 30 Apr 2020 16:35:03 +0200 Subject: Fix plugin get settings --- server/models/server/plugin.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server') diff --git a/server/models/server/plugin.ts b/server/models/server/plugin.ts index 3f88ac26d..c72846343 100644 --- a/server/models/server/plugin.ts +++ b/server/models/server/plugin.ts @@ -123,7 +123,7 @@ export class PluginModel extends Model { return PluginModel.findOne(query) .then(p => { - if (!p || p.settings === undefined) { + if (!p || !p.settings || p.settings === undefined) { const registered = registeredSettings.find(s => s.name === settingName) if (!registered || registered.default === undefined) return undefined @@ -153,7 +153,7 @@ export class PluginModel extends Model { const result: { [settingName: string ]: string | boolean } = {} for (const name of settingNames) { - if (!p || p.settings[name] === undefined) { + if (!p || !p.settings || p.settings[name] === undefined) { const registered = registeredSettings.find(s => s.name === name) if (registered?.default !== undefined) { -- cgit v1.2.3