Skip to content

Commit 8dd9edc

Browse files
Merge pull request #41419 from nextcloud/backport/41404/stable26
[stable26] fix(workflow): Fix "Call to a member function getUID() on null" with …
2 parents 6bf51e0 + 12f4feb commit 8dd9edc

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

apps/workflowengine/lib/Entity/File.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,10 @@ public function prepareRuleMatcher(IRuleMatcher $ruleMatcher, string $eventName,
140140
}
141141
}
142142

143-
public function isLegitimatedForUserId(string $uid): bool {
143+
public function isLegitimatedForUserId(string $userId): bool {
144144
try {
145145
$node = $this->getNode();
146-
if ($node->getOwner()->getUID() === $uid) {
146+
if ($node->getOwner()?->getUID() === $userId) {
147147
return true;
148148
}
149149

@@ -154,7 +154,7 @@ public function isLegitimatedForUserId(string $uid): bool {
154154
$fileId = $node->getId();
155155
}
156156

157-
$mountInfos = $this->userMountCache->getMountsForFileId($fileId, $uid);
157+
$mountInfos = $this->userMountCache->getMountsForFileId($fileId, $userId);
158158
foreach ($mountInfos as $mountInfo) {
159159
$mount = $this->mountManager->getMountFromMountInfo($mountInfo);
160160
if ($mount && $mount->getStorage() && !empty($mount->getStorage()->getCache()->get($fileId))) {

0 commit comments

Comments
 (0)