diff --git a/tests/acceptance/features/bootstrap/WebDav.php b/tests/acceptance/features/bootstrap/WebDav.php index aff520aafde9..dc7440845c87 100644 --- a/tests/acceptance/features/bootstrap/WebDav.php +++ b/tests/acceptance/features/bootstrap/WebDav.php @@ -2706,16 +2706,18 @@ public function findFileFromPropfindResponse($user, $fileNameToSearch) { $this->parseResponseIntoXml(); } $multistatusResults = $this->responseXml["value"]; - foreach ($multistatusResults as $multistatusResult) { - $filePath = $multistatusResult['value'][0]['value']; - $fullWebDavPath = \ltrim( - $this->getBasePath() . "/" . $this->getDavFilesPath($user) . "/", - "/" - ); - $fileName = \str_replace($fullWebDavPath, "", $filePath); - $fileName = \rawurldecode($fileName); - if ($fileName === $fileNameToSearch) { - return $multistatusResult; + if ($multistatusResults !== null) { + foreach ($multistatusResults as $multistatusResult) { + $filePath = $multistatusResult['value'][0]['value']; + $fullWebDavPath = \ltrim( + $this->getBasePath() . "/" . $this->getDavFilesPath($user) . "/", + "/" + ); + $fileName = \str_replace($fullWebDavPath, "", $filePath); + $fileName = \rawurldecode($fileName); + if ($fileName === $fileNameToSearch) { + return $multistatusResult; + } } } return false;