Skip to content

Commit 6caec49

Browse files
authored
Merge pull request #18262 from nextcloud/bugfix/noid/workflow-eventnames-fallback
Make sure event names is always an array
2 parents da84b36 + c3061e6 commit 6caec49

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

apps/workflowengine/lib/AppInfo/Application.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ function ($event) use ($eventName, $operationClass, $entityClass) {
127127
}
128128
}
129129
);
130-
}, $eventNames);
130+
}, $eventNames ?? []);
131131
}
132132
}
133133
}

apps/workflowengine/lib/Manager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public function getAllConfiguredEvents() {
145145
$operations[$operation] = $operations[$row['class']] ?? [];
146146
$operations[$operation][$entity] = $operations[$operation][$entity] ?? [];
147147

148-
$operations[$operation][$entity] = array_unique(array_merge($operations[$operation][$entity], $eventNames));
148+
$operations[$operation][$entity] = array_unique(array_merge($operations[$operation][$entity], $eventNames ?? []));
149149
}
150150
$result->closeCursor();
151151

@@ -589,7 +589,7 @@ public function formatOperation(array $operation): array {
589589

590590
$operation['checks'][] = $check;
591591
}
592-
$operation['events'] = json_decode($operation['events'], true);
592+
$operation['events'] = json_decode($operation['events'], true) ?? [];
593593

594594

595595
return $operation;

0 commit comments

Comments
 (0)