diff --git a/apps/workflowengine/lib/Entity/File.php b/apps/workflowengine/lib/Entity/File.php index 7caaaf0e2258a..5b9c4892f9223 100644 --- a/apps/workflowengine/lib/Entity/File.php +++ b/apps/workflowengine/lib/Entity/File.php @@ -140,10 +140,10 @@ public function prepareRuleMatcher(IRuleMatcher $ruleMatcher, string $eventName, } } - public function isLegitimatedForUserId(string $uid): bool { + public function isLegitimatedForUserId(string $userId): bool { try { $node = $this->getNode(); - if ($node->getOwner()->getUID() === $uid) { + if ($node->getOwner()?->getUID() === $userId) { return true; } @@ -154,7 +154,7 @@ public function isLegitimatedForUserId(string $uid): bool { $fileId = $node->getId(); } - $mountInfos = $this->userMountCache->getMountsForFileId($fileId, $uid); + $mountInfos = $this->userMountCache->getMountsForFileId($fileId, $userId); foreach ($mountInfos as $mountInfo) { $mount = $this->mountManager->getMountFromMountInfo($mountInfo); if ($mount && $mount->getStorage() && !empty($mount->getStorage()->getCache()->get($fileId))) {