diff --git a/lib/private/Files/Storage/Common.php b/lib/private/Files/Storage/Common.php index 5561f6a889..f3e3cb9e58 100644 --- a/lib/private/Files/Storage/Common.php +++ b/lib/private/Files/Storage/Common.php @@ -436,10 +436,14 @@ abstract class Common implements Storage, ILockingStorage { * @return bool */ public function test() { - if ($this->stat('')) { - return true; + try { + if ($this->stat('')) { + return true; + } + return false; + } catch (\Exception $e) { + return false; } - return false; } /** diff --git a/lib/private/Files/Storage/DAV.php b/lib/private/Files/Storage/DAV.php index abe219f99f..3b89a66d6a 100644 --- a/lib/private/Files/Storage/DAV.php +++ b/lib/private/Files/Storage/DAV.php @@ -569,8 +569,8 @@ class DAV extends Common { public function stat($path) { try { $response = $this->propfind($path); - if ($response === false) { - return []; + if (!$response) { + return false; } return [ 'mtime' => strtotime($response['{DAV:}getlastmodified']),