mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
Don't call getUid() on null
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
This commit is contained in:
parent
902ba76d30
commit
07c0223863
1 changed files with 6 additions and 2 deletions
|
|
@ -351,7 +351,7 @@ class FileEventsListener implements IEventListener {
|
|||
|
||||
/**
|
||||
* Retrieve the path relative to the current user root folder.
|
||||
* If no user is connected, use the node's owner.
|
||||
* If no user is connected, try to use the node's owner.
|
||||
*/
|
||||
private function getPathForNode(Node $node): ?string {
|
||||
try {
|
||||
|
|
@ -359,8 +359,12 @@ 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($node->getOwner()->getUid())
|
||||
->getUserFolder($owner->getUid())
|
||||
->getRelativePath($node->getPath());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue