aboutsummaryrefslogtreecommitdiffstats
path: root/apps/workflowengine/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-11-13 09:00:40 +0100
committerJoas Schilling <coding@schilljs.com>2023-11-13 09:00:40 +0100
commit997a1c46fbbc639e857e10ccc816437d971af134 (patch)
treec8c4ac556a5f534e25ac6b28d46dac17029f727f /apps/workflowengine/lib
parent36d370b2163ac2a98dbecf2400eb1300025b79b2 (diff)
downloadnextcloud-server-997a1c46fbbc639e857e10ccc816437d971af134.tar.gz
nextcloud-server-997a1c46fbbc639e857e10ccc816437d971af134.zip
fix(workflow): Fix "Call to a member function getUID() on null" with appdata
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/workflowengine/lib')
-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))) {