summaryrefslogtreecommitdiffstats
path: root/lib/private/files
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2016-03-12 22:45:07 +0100
committerLukas Reschke <lukas@owncloud.com>2016-03-12 22:45:07 +0100
commitd43051f7def4da8e8e1213c24bb52a9992ec5ce5 (patch)
treeb1e7063117157492b853436712cc43518615ce82 /lib/private/files
parent5862a067d9d67d3ef70cb064009f81b47ed15efd (diff)
downloadnextcloud-server-d43051f7def4da8e8e1213c24bb52a9992ec5ce5.tar.gz
nextcloud-server-d43051f7def4da8e8e1213c24bb52a9992ec5ce5.zip
Verify the getResponse returns a ResponseInterface
Can also return `null` as per PHPDoc. Regression added by https://github.com/owncloud/core/commit/97f5c095f4018119e15d7c612a685da1dc91a340 Fixes https://github.com/owncloud/core/issues/23145
Diffstat (limited to 'lib/private/files')
-rw-r--r--lib/private/files/storage/dav.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/private/files/storage/dav.php b/lib/private/files/storage/dav.php
index 495419fa865..df0f4c7e91d 100644
--- a/lib/private/files/storage/dav.php
+++ b/lib/private/files/storage/dav.php
@@ -34,6 +34,7 @@ namespace OC\Files\Storage;
use Exception;
use GuzzleHttp\Exception\RequestException;
+use GuzzleHttp\Message\ResponseInterface;
use OC\Files\Filesystem;
use OC\Files\Stream\Close;
use Icewind\Streams\IteratorDirectory;
@@ -351,7 +352,8 @@ class DAV extends Common {
'stream' => true
]);
} catch (RequestException $e) {
- if ($e->getResponse()->getStatusCode() === 404) {
+ if ($e->getResponse() instanceof ResponseInterface
+ && $e->getResponse()->getStatusCode() === 404) {
return false;
} else {
throw $e;