mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[rubygems/rubygems] Return early if filename is empty
https://github.com/rubygems/rubygems/commit/1b9ab33083
This commit is contained in:
parent
d74ea2eeb2
commit
673ef894ac
2 changed files with 2 additions and 2 deletions
|
@ -334,7 +334,7 @@ if you believe they were disclosed to a third party.
|
|||
yaml_errors = [ArgumentError]
|
||||
yaml_errors << Psych::SyntaxError if defined?(Psych::SyntaxError)
|
||||
|
||||
return {} unless filename and File.exist? filename
|
||||
return {} unless filename && !filename.empty? && File.exist?(filename)
|
||||
|
||||
begin
|
||||
content = Gem::SafeYAML.load(File.read(filename))
|
||||
|
|
|
@ -19,7 +19,7 @@ class TestGemConfigFile < Gem::TestCase
|
|||
Gem::ConfigFile::PLATFORM_DEFAULTS.clear
|
||||
|
||||
@env_gemrc = ENV['GEMRC']
|
||||
ENV['GEMRC'] = nil
|
||||
ENV['GEMRC'] = ''
|
||||
|
||||
util_config_file
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue