From 4666fedaed1f0b368bd98273f83c29a3fad5615e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volker=20Z=C3=B6pfel?= Date: Thu, 28 Nov 2013 10:24:47 +0100 Subject: [PATCH] load_credentials just returns nil on errors --- lib/google/api_client/auth/storages/file_store.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/google/api_client/auth/storages/file_store.rb b/lib/google/api_client/auth/storages/file_store.rb index 1b8ad4a36..850dee2d0 100644 --- a/lib/google/api_client/auth/storages/file_store.rb +++ b/lib/google/api_client/auth/storages/file_store.rb @@ -37,10 +37,9 @@ module Google ## # Attempt to read in credentials from the specified file. def load_credentials - if File.exists?(path) && File.readable?(path) && File.writable?(path) - credentials = File.open(path, 'r') { |f| JSON.parse(f.read) } - end - credentials + File.open(path, 'r') { |f| JSON.parse(f.read) } + rescue + nil end ##