From 65047cbdd44b84c38a7092341e0a71fe08297663 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 13 Nov 2023 09:00:40 +0100 Subject: [PATCH] fix(workflow): Fix "Call to a member function getUID() on null" with appdata Signed-off-by: Joas Schilling --- apps/workflowengine/lib/Entity/File.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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))) {