diff --git a/apps/files_versions/lib/Listener/FileEventsListener.php b/apps/files_versions/lib/Listener/FileEventsListener.php index 263eb7816eeb0..8416b4adc1e52 100644 --- a/apps/files_versions/lib/Listener/FileEventsListener.php +++ b/apps/files_versions/lib/Listener/FileEventsListener.php @@ -384,7 +384,7 @@ private function getPathForNode(Node $node): ?string { $owner = $node->getOwner()?->getUid(); - if ($owner !== null) { + if ($owner !== null && $owner !== '') { $path = $this->rootFolder ->getUserFolder($owner) ->getRelativePath($node->getPath()); @@ -404,6 +404,10 @@ private function getPathForNode(Node $node): ?string { $owner = $parts[1]; } + if($owner === '' || $owner === null) { + return null; + } + return $this->rootFolder ->getUserFolder($owner) ->getRelativePath($node->getPath());