Merge pull request #41612 from nextcloud/revert-41553-backport/41518/stable27

Revert "[stable27] fix(files_versions): don't call getUid() on null"
This commit is contained in:
Arthur Schiwon 2023-11-22 11:34:17 +01:00 committed by GitHub
commit 81e5453b35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -351,7 +351,7 @@ class FileEventsListener implements IEventListener {
/**
* Retrieve the path relative to the current user root folder.
* If no user is connected, try to use the node's owner.
* If no user is connected, use the node's owner.
*/
private function getPathForNode(Node $node): ?string {
try {
@ -359,12 +359,8 @@ class FileEventsListener implements IEventListener {
->getUserFolder(\OC_User::getUser())
->getRelativePath($node->getPath());
} catch (\Throwable $ex) {
$owner = $node->getOwner();
if ($owner === null) {
return null;
}
return $this->rootFolder
->getUserFolder($owner->getUid())
->getUserFolder($node->getOwner()->getUid())
->getRelativePath($node->getPath());
}
}