load_credentials just returns nil on errors
authorVolker Zöpfel <volker@zoepfel.de>
Thu, 28 Nov 2013 09:24:47 +0000 (10:24 +0100)
committerVolker Zöpfel <volker@zoepfel.de>
Thu, 28 Nov 2013 09:24:47 +0000 (10:24 +0100)
lib/google/api_client/auth/storages/file_store.rb

index 1b8ad4a36a7692f78194bade6bf18e822383ce7b..850dee2d0af332872f9f109704bf93bca400a13c 100644 (file)
@@ -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
 
       ##