Merge pull request #18262 from nextcloud/bugfix/noid/workflow-eventnames-fallback

Make sure event names is always an array
This commit is contained in:
Roeland Jago Douma 2019-12-06 11:36:56 +01:00 committed by GitHub
commit 6caec491c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -127,7 +127,7 @@ class Application extends \OCP\AppFramework\App {
}
}
);
}, $eventNames);
}, $eventNames ?? []);
}
}
}

View 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;