aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2023-11-13 11:02:24 +0100
committerGitHub <noreply@github.com>2023-11-13 11:02:24 +0100
commit476dcfdd6b85db8e654665fc855e80e68a37ee66 (patch)
tree3611386255284a5dba79cd8da2345bfce896aaa2
parent0feb55ee93b579bfcba30410325ca0c28f501779 (diff)
parent997a1c46fbbc639e857e10ccc816437d971af134 (diff)
downloadnextcloud-server-476dcfdd6b85db8e654665fc855e80e68a37ee66.tar.gz
nextcloud-server-476dcfdd6b85db8e654665fc855e80e68a37ee66.zip
Merge pull request #41404 from nextcloud/bugfix/noid/workflow-issue-on-appdata
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 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))) {