summaryrefslogtreecommitdiffstats
path: root/apps/files_versions
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2023-11-20 10:52:00 +0100
committerGitHub <noreply@github.com>2023-11-20 10:52:00 +0100
commit5103669ff8fc1920b4ad2e26f2b85e8baeeff207 (patch)
tree72d6d3fdc8ffcc93e2be01a52a340ae4ffe682e7 /apps/files_versions
parent5b16df8dd1f12858c97a42c1a3e85e49382395e5 (diff)
downloadnextcloud-server-5103669ff8fc1920b4ad2e26f2b85e8baeeff207.tar.gz
nextcloud-server-5103669ff8fc1920b4ad2e26f2b85e8baeeff207.zip
Revert "[stable27] fix(files_versions): don't call getUid() on null"
Diffstat (limited to 'apps/files_versions')
-rw-r--r--apps/files_versions/lib/Listener/FileEventsListener.php8
1 files changed, 2 insertions, 6 deletions
diff --git a/apps/files_versions/lib/Listener/FileEventsListener.php b/apps/files_versions/lib/Listener/FileEventsListener.php
index 323b92b3920..d90283bacc8 100644
--- a/apps/files_versions/lib/Listener/FileEventsListener.php
+++ b/apps/files_versions/lib/Listener/FileEventsListener.php
@@ -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());
}
}