]> source.dussan.org Git - nextcloud-server.git/commitdiff
Flows that are managing themselves do not necessarily set the entity 18461/head
authorArthur Schiwon <blizzz@arthur-schiwon.de>
Wed, 18 Dec 2019 08:35:03 +0000 (09:35 +0100)
committerArthur Schiwon <blizzz@arthur-schiwon.de>
Wed, 18 Dec 2019 08:35:03 +0000 (09:35 +0100)
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>
apps/workflowengine/lib/Service/RuleMatcher.php

index 6186df1d7b959e5655b9ce74dbb6f9d9ed0d1484..57e3813c309534fd0a8c67a633617905b4107e6e 100644 (file)
@@ -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));
+                               }
                        }
                }