diff --git a/apps/files_external/lib/google.php b/apps/files_external/lib/google.php
index 982fa6bb48f1a71e538ea5ce4a6d291c815dc9a7..3e8b60d33df7448708384099dcbf1f5f3e7d513e 100644
--- a/apps/files_external/lib/google.php
+++ b/apps/files_external/lib/google.php
@@ -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;
 							}