diff options
Diffstat (limited to 'server/lib/plugins/plugin-manager.ts')
-rw-r--r-- | server/lib/plugins/plugin-manager.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/server/lib/plugins/plugin-manager.ts b/server/lib/plugins/plugin-manager.ts index afc07a151..cfe63e50d 100644 --- a/server/lib/plugins/plugin-manager.ts +++ b/server/lib/plugins/plugin-manager.ts | |||
@@ -13,7 +13,7 @@ import { RegisterSettingOptions } from '../../../shared/models/plugins/register- | |||
13 | import { RegisterHookOptions } from '../../../shared/models/plugins/register-hook.model' | 13 | import { RegisterHookOptions } from '../../../shared/models/plugins/register-hook.model' |
14 | import { PluginSettingsManager } from '../../../shared/models/plugins/plugin-settings-manager.model' | 14 | import { PluginSettingsManager } from '../../../shared/models/plugins/plugin-settings-manager.model' |
15 | import { PluginStorageManager } from '../../../shared/models/plugins/plugin-storage-manager.model' | 15 | import { PluginStorageManager } from '../../../shared/models/plugins/plugin-storage-manager.model' |
16 | import { ServerHook, ServerHookName } from '../../../shared/models/plugins/server-hook.model' | 16 | import { ServerHook, ServerHookName, serverHookObject } from '../../../shared/models/plugins/server-hook.model' |
17 | import { getHookType, internalRunHook } from '../../../shared/core-utils/plugins/hooks' | 17 | import { getHookType, internalRunHook } from '../../../shared/core-utils/plugins/hooks' |
18 | import { RegisterOptions } from '../../typings/plugins/register-options.model' | 18 | import { RegisterOptions } from '../../typings/plugins/register-options.model' |
19 | import { PluginLibrary } from '../../typings/plugins' | 19 | import { PluginLibrary } from '../../typings/plugins' |
@@ -388,6 +388,11 @@ export class PluginManager implements ServerHook { | |||
388 | 388 | ||
389 | private getRegisterHelpers (npmName: string, plugin: PluginModel): RegisterOptions { | 389 | private getRegisterHelpers (npmName: string, plugin: PluginModel): RegisterOptions { |
390 | const registerHook = (options: RegisterHookOptions) => { | 390 | const registerHook = (options: RegisterHookOptions) => { |
391 | if (serverHookObject[options.target] !== true) { | ||
392 | logger.warn('Unknown hook %s of plugin %s. Skipping.', options.target, npmName) | ||
393 | return | ||
394 | } | ||
395 | |||
391 | if (!this.hooks[options.target]) this.hooks[options.target] = [] | 396 | if (!this.hooks[options.target]) this.hooks[options.target] = [] |
392 | 397 | ||
393 | this.hooks[options.target].push({ | 398 | this.hooks[options.target].push({ |