mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 07:45:18 +00:00
fix(plugin-workflow): defend unimplemented trigger type (#3263)
This commit is contained in:
parent
28759aac07
commit
b68fde9d47
@ -235,6 +235,10 @@ export default class WorkflowPlugin extends Plugin {
|
||||
toggle(workflow: WorkflowModel, enable?: boolean) {
|
||||
const type = workflow.get('type');
|
||||
const trigger = this.triggers.get(type);
|
||||
if (!trigger) {
|
||||
this.getLogger(workflow.id).error(`trigger type ${workflow.type} of workflow ${workflow.id} is not implemented`);
|
||||
return;
|
||||
}
|
||||
if (typeof enable !== 'undefined' ? enable : workflow.get('enabled')) {
|
||||
// NOTE: remove previous listener if config updated
|
||||
const prev = workflow.previous();
|
||||
|
Loading…
Reference in New Issue
Block a user