From 997a1c46fbbc639e857e10ccc816437d971af134 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 13 Nov 2023 09:00:40 +0100 Subject: 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(-) (limited to 'apps/workflowengine/lib') diff --git a/apps/workflowengine/lib/Entity/File.php b/apps/workflowengine/lib/Entity/File.php index 1f0d3a00553..716774c03a9 100644 --- a/apps/workflowengine/lib/Entity/File.php +++ b/apps/workflowengine/lib/Entity/File.php @@ -135,10 +135,10 @@ class File implements IEntity, IDisplayText, IUrl, IIcon, IContextPortation { } } - 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; } @@ -149,7 +149,7 @@ class File implements IEntity, IDisplayText, IUrl, IIcon, IContextPortation { $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))) { -- cgit v1.2.3