Skip to content

Commit 4666fed

Browse files
committed
load_credentials just returns nil on errors
1 parent 31fac0a commit 4666fed

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/google/api_client/auth/storages/file_store.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,9 @@ def initialize(path)
3737
##
3838
# Attempt to read in credentials from the specified file.
3939
def load_credentials
40-
if File.exists?(path) && File.readable?(path) && File.writable?(path)
41-
credentials = File.open(path, 'r') { |f| JSON.parse(f.read) }
42-
end
43-
credentials
40+
File.open(path, 'r') { |f| JSON.parse(f.read) }
41+
rescue
42+
nil
4443
end
4544

4645
##

0 commit comments

Comments
 (0)