summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2023-11-22 11:34:17 +0100
committerGitHub <noreply@github.com>2023-11-22 11:34:17 +0100
commit81e5453b35ed3307ac92df2c5a60d1d4ab5eb69f (patch)
tree415b64666c1e3367d7f2ac66a0430e121a737d85
parent775703ec7320c5bd90d1d9905883c90810f8c510 (diff)
parent5103669ff8fc1920b4ad2e26f2b85e8baeeff207 (diff)
downloadnextcloud-server-81e5453b35ed3307ac92df2c5a60d1d4ab5eb69f.tar.gz
nextcloud-server-81e5453b35ed3307ac92df2c5a60d1d4ab5eb69f.zip
Merge pull request #41612 from nextcloud/revert-41553-backport/41518/stable27
Revert "[stable27] fix(files_versions): don't call getUid() on null"
-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());
}
}