mirror of
https://github.com/IT4Change/gradido.git
synced 2026-03-01 12:44:43 +00:00
change check for commandClass
This commit is contained in:
parent
7615d6efb1
commit
92077f954d
@ -27,7 +27,7 @@ export class CommandFactory {
|
|||||||
}
|
}
|
||||||
this.commands.set(name, commandClass);
|
this.commands.set(name, commandClass);
|
||||||
if (methodLogger.isDebugEnabled()) {
|
if (methodLogger.isDebugEnabled()) {
|
||||||
methodLogger.debug(`registerCommand() commands=${JSON.stringify(Array.from(this.commands.entries()))}`)
|
methodLogger.debug(`registerCommand() commands=${JSON.stringify(this.commands.entries())}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -38,9 +38,9 @@ export class CommandFactory {
|
|||||||
}
|
}
|
||||||
const CommandClass = this.commands.get(name);
|
const CommandClass = this.commands.get(name);
|
||||||
if (methodLogger.isDebugEnabled()) {
|
if (methodLogger.isDebugEnabled()) {
|
||||||
methodLogger.debug(`createCommand() name=${name} commandClass=${CommandClass ? JSON.stringify(CommandClass) : 'null'}`)
|
methodLogger.debug(`createCommand() name=${name} commandClass=${CommandClass ? CommandClass.name : 'null'}`)
|
||||||
}
|
}
|
||||||
if (!CommandClass) {
|
if (CommandClass === undefined) {
|
||||||
const errmsg = `Command ${name} not found`;
|
const errmsg = `Command ${name} not found`;
|
||||||
methodLogger.error(errmsg);
|
methodLogger.error(errmsg);
|
||||||
throw new Error(errmsg);
|
throw new Error(errmsg);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user