diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index cb22e14aec0ac..3fc6ce8ad0dd3 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -1177,7 +1177,7 @@ public function getInheritedShares(string $path): DataResponse { $nodes = []; while (true) { $node = $node->getParent(); - if ($node->getPath() === $basePath) { + if ($node->getId() < 0 || $node->getPath() === $basePath) { break; } $nodes[] = $node;