Skip to content

Commit 452a9c2

Browse files
Merge pull request #61258 from nextcloud/backport/61245/stable34
[stable34] fix: Fix PHP Warning foreach() argument must be of type array|object, null given
2 parents e53ed33 + 3a29196 commit 452a9c2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/private/Share20/ShareHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ protected function getPathsForUsers(Node $node, array $users): array {
103103
try {
104104
$item = $item->getParent();
105105

106-
if ($byId[$item->getId()] !== []) {
106+
if (isset($byId[$item->getId()]) && $byId[$item->getId()] !== []) {
107107
foreach ($byId[$item->getId()] as $uid => $path) {
108108
$results[$uid] = $path . $appendix;
109109
}
@@ -160,7 +160,7 @@ protected function getPathsForRemotes(Node $node, array $remotes): array {
160160
$item = $node;
161161
while (!empty($byId)) {
162162
try {
163-
if ($byId[$item->getId()] !== []) {
163+
if (isset($byId[$item->getId()]) && $byId[$item->getId()] !== []) {
164164
$path = $this->getMountedPath($item);
165165
foreach ($byId[$item->getId()] as $uid => $token) {
166166
$results[$uid] = [

0 commit comments

Comments
 (0)