diff options
-rw-r--r-- | apps/files_versions/lib/Listener/FileEventsListener.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/files_versions/lib/Listener/FileEventsListener.php b/apps/files_versions/lib/Listener/FileEventsListener.php index 5fe41f76e49..206c75ec6ec 100644 --- a/apps/files_versions/lib/Listener/FileEventsListener.php +++ b/apps/files_versions/lib/Listener/FileEventsListener.php @@ -350,16 +350,24 @@ class FileEventsListener implements IEventListener { private function getPathForNode(Node $node): ?string { $user = $this->userSession->getUser()?->getUID(); if ($user) { - return $this->rootFolder + $path = $this->rootFolder ->getUserFolder($user) ->getRelativePath($node->getPath()); + + if ($path !== null) { + return $path; + } } $owner = $node->getOwner()?->getUid(); if ($owner) { - return $this->rootFolder + $path = $this->rootFolder ->getUserFolder($owner) ->getRelativePath($node->getPath()); + + if ($path !== null) { + return $path; + } } return null; |