]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(workflow): Fix "Call to a member function getUID() on null" with appdata 41404/head
authorJoas Schilling <coding@schilljs.com>
Mon, 13 Nov 2023 08:00:40 +0000 (09:00 +0100)
committerJoas Schilling <coding@schilljs.com>
Mon, 13 Nov 2023 08:00:40 +0000 (09:00 +0100)
Signed-off-by: Joas Schilling <coding@schilljs.com>
apps/workflowengine/lib/Entity/File.php

index 1f0d3a005537d23cf5e6dd7e503ddd90d06557ff..716774c03a9e6b0885add1b6dfa67789cce8346a 100644 (file)
@@ -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))) {