Skip to content

Commit

Permalink
Merge pull request #41418 from nextcloud/backport/41404/stable27
Browse files Browse the repository at this point in the history
[stable27] fix(workflow): Fix "Call to a member function getUID() on null" with …
  • Loading branch information
blizzz authored Nov 13, 2023
2 parents 712a4c8 + 65047cb commit 5d081f7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apps/workflowengine/lib/Entity/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ public function prepareRuleMatcher(IRuleMatcher $ruleMatcher, string $eventName,
}
}

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;
}

Expand All @@ -154,7 +154,7 @@ public function isLegitimatedForUserId(string $uid): bool {
$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))) {
Expand Down

0 comments on commit 5d081f7

Please sign in to comment.