fix(workflow): Fix "Call to a member function getUID() on null" with appdata

Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/41404/head
Joas Schilling 3 years ago
parent 36d370b216
commit 997a1c46fb
No known key found for this signature in database
GPG Key ID: 74434EFE0D2E2205
  1. 6
      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))) {

Loading…
Cancel
Save