aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-04-30 16:35:03 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-05-04 16:21:39 +0200
commit15b4bcdf04db86c655ae16d4832ae2a8f0e55829 (patch)
tree5ec8dfd9fed65e47d885bdde1591e36351f65bda /server/models
parent5644f9b0351c71601312b13c49d89b0ce05c74e3 (diff)
downloadPeerTube-15b4bcdf04db86c655ae16d4832ae2a8f0e55829.tar.gz
PeerTube-15b4bcdf04db86c655ae16d4832ae2a8f0e55829.tar.zst
PeerTube-15b4bcdf04db86c655ae16d4832ae2a8f0e55829.zip
Fix plugin get settings
Diffstat (limited to 'server/models')
-rw-r--r--server/models/server/plugin.ts4
1 files changed, 2 insertions, 2 deletions
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<PluginModel> {
123 123
124 return PluginModel.findOne(query) 124 return PluginModel.findOne(query)
125 .then(p => { 125 .then(p => {
126 if (!p || p.settings === undefined) { 126 if (!p || !p.settings || p.settings === undefined) {
127 const registered = registeredSettings.find(s => s.name === settingName) 127 const registered = registeredSettings.find(s => s.name === settingName)
128 if (!registered || registered.default === undefined) return undefined 128 if (!registered || registered.default === undefined) return undefined
129 129
@@ -153,7 +153,7 @@ export class PluginModel extends Model<PluginModel> {
153 const result: { [settingName: string ]: string | boolean } = {} 153 const result: { [settingName: string ]: string | boolean } = {}
154 154
155 for (const name of settingNames) { 155 for (const name of settingNames) {
156 if (!p || p.settings[name] === undefined) { 156 if (!p || !p.settings || p.settings[name] === undefined) {
157 const registered = registeredSettings.find(s => s.name === name) 157 const registered = registeredSettings.find(s => s.name === name)
158 158
159 if (registered?.default !== undefined) { 159 if (registered?.default !== undefined) {