From aebb900cd45a38ba9e7f6dfd6217e83e260dc40f Mon Sep 17 00:00:00 2001
From: Lukas Reschke <lukas@owncloud.com>
Date: Thu, 25 Feb 2016 10:12:31 +0100
Subject: [PATCH] More error handling

---
 apps/files_external/lib/google.php | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/apps/files_external/lib/google.php b/apps/files_external/lib/google.php
index 982fa6bb48f..3e8b60d33df 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;
 							}
-- 
GitLab