Merge pull request #41404 from nextcloud/bugfix/noid/workflow-issue-on-appdata

fix(workflow): Fix "Call to a member function getUID() on null" with …
This commit is contained in:
Joas Schilling 2023-11-13 11:02:24 +01:00 committed by GitHub
commit 476dcfdd6b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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))) {