diff options
author | Joas Schilling <coding@schilljs.com> | 2023-11-13 09:00:40 +0100 |
---|---|---|
committer | backportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com> | 2023-11-13 12:23:41 +0000 |
commit | 65047cbdd44b84c38a7092341e0a71fe08297663 (patch) | |
tree | 13e952b9f77a7fa25235fe1cfd71db73ab65e61c | |
parent | a61c609e9217befad24528e4c59cef92284ece49 (diff) | |
download | nextcloud-server-65047cbdd44b84c38a7092341e0a71fe08297663.tar.gz nextcloud-server-65047cbdd44b84c38a7092341e0a71fe08297663.zip |
fix(workflow): Fix "Call to a member function getUID() on null" with appdata
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r-- | apps/workflowengine/lib/Entity/File.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/workflowengine/lib/Entity/File.php b/apps/workflowengine/lib/Entity/File.php index 7caaaf0e225..5b9c4892f92 100644 --- a/apps/workflowengine/lib/Entity/File.php +++ b/apps/workflowengine/lib/Entity/File.php @@ -140,10 +140,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; } @@ -154,7 +154,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))) { |