From: Chocobozzz Date: Thu, 30 Apr 2020 14:35:03 +0000 (+0200) Subject: Fix plugin get settings X-Git-Tag: v2.2.0-rc.1~100 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=15b4bcdf04db86c655ae16d4832ae2a8f0e55829;p=oweals%2Fpeertube.git Fix plugin get settings --- 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) {