]> source.dussan.org Git - nextcloud-server.git/commitdiff
Make sure event names is always an array 18262/head
authorJulius Härtl <jus@bitgrid.net>
Fri, 6 Dec 2019 09:32:37 +0000 (10:32 +0100)
committerJulius Härtl <jus@bitgrid.net>
Fri, 6 Dec 2019 09:32:55 +0000 (10:32 +0100)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
apps/workflowengine/lib/AppInfo/Application.php
apps/workflowengine/lib/Manager.php

index 933d0cb7544eb0bf36f44e091a50c68474243f1c..2d04e2a1bf9f7176c4fa96634af90a5114ab2860 100644 (file)
@@ -127,7 +127,7 @@ class Application extends \OCP\AppFramework\App {
                                                        }
                                                }
                                        );
-                               }, $eventNames);
+                               }, $eventNames ?? []);
                        }
                }
        }
index f97d77f598390e6f95b8006adf57e85fa5f7f6f4..0dbe7dbfc13008879dbcee3cbbfc1012dd9a2bc5 100644 (file)
@@ -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;