From 3a29196aa1d34a83c37d699141c892f4a20c221b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Fri, 12 Jun 2026 14:28:42 +0200 Subject: [PATCH] fix: Fix PHP Warning foreach() argument must be of type array|object, null given MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- lib/private/Share20/ShareHelper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/private/Share20/ShareHelper.php b/lib/private/Share20/ShareHelper.php index 4b4e57ecb0bb6..df19bd0f64338 100644 --- a/lib/private/Share20/ShareHelper.php +++ b/lib/private/Share20/ShareHelper.php @@ -103,7 +103,7 @@ protected function getPathsForUsers(Node $node, array $users): array { try { $item = $item->getParent(); - if ($byId[$item->getId()] !== []) { + if (isset($byId[$item->getId()]) && $byId[$item->getId()] !== []) { foreach ($byId[$item->getId()] as $uid => $path) { $results[$uid] = $path . $appendix; } @@ -160,7 +160,7 @@ protected function getPathsForRemotes(Node $node, array $remotes): array { $item = $node; while (!empty($byId)) { try { - if ($byId[$item->getId()] !== []) { + if (isset($byId[$item->getId()]) && $byId[$item->getId()] !== []) { $path = $this->getMountedPath($item); foreach ($byId[$item->getId()] as $uid => $token) { $results[$uid] = [