Skip to content

Commit 9b09259

Browse files
committed
Fixed a bug with adding plugins that only had a startup method
1 parent f66a4a4 commit 9b09259

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

packages/core/src/configuration/Configuration.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -471,8 +471,8 @@ export class Configuration {
471471
const plugin: IEventPlugin = pluginAction
472472
? { name: pluginOrName as string, priority, run: pluginAction }
473473
: pluginOrName as IEventPlugin;
474-
if (!plugin || !plugin.run) {
475-
this.services.log.error("Add plugin failed: Run method not defined");
474+
if (!plugin || !(plugin.startup || plugin.run)) {
475+
this.services.log.error("Add plugin failed: startup or run method not defined");
476476
return;
477477
}
478478

@@ -509,9 +509,7 @@ export class Configuration {
509509
* @param name
510510
*/
511511
public removePlugin(pluginOrName: IEventPlugin | string): void {
512-
const name: string = typeof pluginOrName === "string"
513-
? pluginOrName
514-
: pluginOrName.name;
512+
const name: string = typeof pluginOrName === "string" ? pluginOrName : pluginOrName.name;
515513
if (!name) {
516514
this.services.log.error("Remove plugin failed: Plugin name not defined");
517515
return;

0 commit comments

Comments
 (0)