aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2023-11-13 22:27:30 +0100
committerGitHub <noreply@github.com>2023-11-13 22:27:30 +0100
commit5d081f7dd85b4f15d883b85b470b74a94207af22 (patch)
treefb926e950c9d6bd54d5f215b108112107a99025e
parent712a4c8e101cf742a3d01f79a494bac898c2874a (diff)
parent65047cbdd44b84c38a7092341e0a71fe08297663 (diff)
downloadnextcloud-server-5d081f7dd85b4f15d883b85b470b74a94207af22.tar.gz
nextcloud-server-5d081f7dd85b4f15d883b85b470b74a94207af22.zip
Merge pull request #41418 from nextcloud/backport/41404/stable27
[stable27] fix(workflow): Fix "Call to a member function getUID() on null" with …
-rw-r--r--apps/workflowengine/lib/Entity/File.php6
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))) {