From c3061e69294a8394ecd8fbbb1376e592ef4bc6d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Fri, 6 Dec 2019 10:32:37 +0100 Subject: [PATCH] Make sure event names is always an array MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- apps/workflowengine/lib/AppInfo/Application.php | 2 +- apps/workflowengine/lib/Manager.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/workflowengine/lib/AppInfo/Application.php b/apps/workflowengine/lib/AppInfo/Application.php index 933d0cb754..2d04e2a1bf 100644 --- a/apps/workflowengine/lib/AppInfo/Application.php +++ b/apps/workflowengine/lib/AppInfo/Application.php @@ -127,7 +127,7 @@ class Application extends \OCP\AppFramework\App { } } ); - }, $eventNames); + }, $eventNames ?? []); } } } diff --git a/apps/workflowengine/lib/Manager.php b/apps/workflowengine/lib/Manager.php index f97d77f598..0dbe7dbfc1 100644 --- a/apps/workflowengine/lib/Manager.php +++ b/apps/workflowengine/lib/Manager.php @@ -145,7 +145,7 @@ class Manager implements IManager { $operations[$operation] = $operations[$row['class']] ?? []; $operations[$operation][$entity] = $operations[$operation][$entity] ?? []; - $operations[$operation][$entity] = array_unique(array_merge($operations[$operation][$entity], $eventNames)); + $operations[$operation][$entity] = array_unique(array_merge($operations[$operation][$entity], $eventNames ?? [])); } $result->closeCursor(); @@ -589,7 +589,7 @@ class Manager implements IManager { $operation['checks'][] = $check; } - $operation['events'] = json_decode($operation['events'], true); + $operation['events'] = json_decode($operation['events'], true) ?? []; return $operation;