From d551047b8a4d988d535e7904a7f92e3cc33f420e 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 d45325d58690a..0516e55133f9b 100644 --- a/lib/private/Share20/ShareHelper.php +++ b/lib/private/Share20/ShareHelper.php @@ -104,7 +104,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; } @@ -161,7 +161,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] = [