More error handling

This commit is contained in:
Lukas Reschke 2016-02-25 10:12:31 +01:00
parent 3b5ddb417c
commit aebb900cd4
1 changed files with 6 additions and 2 deletions

View File

@ -446,8 +446,12 @@ class Google extends \OC\Files\Storage\Common {
'save_to' => $tmpFile,
]);
} catch (RequestException $e) {
if ($e->getResponse()->getStatusCode() === 404) {
return false;
if(!is_null($e->getResponse())) {
if ($e->getResponse()->getStatusCode() === 404) {
return false;
} else {
throw $e;
}
} else {
throw $e;
}