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
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) {