aboutsummaryrefslogtreecommitdiffstats
path: root/apps/workflowengine
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2019-12-18 09:35:03 +0100
committerArthur Schiwon <blizzz@arthur-schiwon.de>2019-12-18 09:35:03 +0100
commit0a00903261425caac68fd95b996f3051e6776754 (patch)
treed6e3300f8bd8968c71b9f107afe60dafa6d942d5 /apps/workflowengine
parent34c48aaa92a7ca39b16abb3ce3c0416c757e87ea (diff)
downloadnextcloud-server-0a00903261425caac68fd95b996f3051e6776754.tar.gz
nextcloud-server-0a00903261425caac68fd95b996f3051e6776754.zip
Flows that are managing themselves do not necessarily set the entity
for instance files_automatedtagging, which works on a lower level. Fixes a Call to a member function isLegitimatedForUserId() on null. Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/workflowengine')
-rw-r--r--apps/workflowengine/lib/Service/RuleMatcher.php18
1 files changed, 10 insertions, 8 deletions
diff --git a/apps/workflowengine/lib/Service/RuleMatcher.php b/apps/workflowengine/lib/Service/RuleMatcher.php
index 6186df1d7b9..57e3813c309 100644
--- a/apps/workflowengine/lib/Service/RuleMatcher.php
+++ b/apps/workflowengine/lib/Service/RuleMatcher.php
@@ -121,14 +121,16 @@ class RuleMatcher implements IRuleMatcher {
$operations = array_merge($operations, $this->manager->getOperations($class, $scope));
}
- $additionalScopes = $this->manager->getAllConfiguredScopesForOperation($class);
- foreach ($additionalScopes as $hash => $scopeCandidate) {
- /** @var ScopeContext $scopeCandidate */
- if ($scopeCandidate->getScope() !== IManager::SCOPE_USER || in_array($scopeCandidate, $scopes)) {
- continue;
- }
- if ($this->entity->isLegitimatedForUserId($scopeCandidate->getScopeId())) {
- $operations = array_merge($operations, $this->manager->getOperations($class, $scopeCandidate));
+ if($this->entity instanceof IEntity) {
+ $additionalScopes = $this->manager->getAllConfiguredScopesForOperation($class);
+ foreach ($additionalScopes as $hash => $scopeCandidate) {
+ /** @var ScopeContext $scopeCandidate */
+ if ($scopeCandidate->getScope() !== IManager::SCOPE_USER || in_array($scopeCandidate, $scopes)) {
+ continue;
+ }
+ if ($this->entity->isLegitimatedForUserId($scopeCandidate->getScopeId())) {
+ $operations = array_merge($operations, $this->manager->getOperations($class, $scopeCandidate));
+ }
}
}