lib/rubocop/config_obsoletion.rb in rubocop-1.62.1 vs lib/rubocop/config_obsoletion.rb in rubocop-1.63.0
- old
+ new
@@ -50,10 +50,10 @@
# Default rules for obsoletions are in config/obsoletion.yml
# Additional rules files can be added with `RuboCop::ConfigObsoletion.files << filename`
def load_rules # rubocop:disable Metrics/AbcSize
rules = LOAD_RULES_CACHE[self.class.files] ||=
self.class.files.each_with_object({}) do |filename, hash|
- hash.merge!(YAML.safe_load(File.read(filename))) do |_key, first, second|
+ hash.merge!(YAML.safe_load(File.read(filename)) || {}) do |_key, first, second|
case first
when Hash
first.merge(second)
when Array
first.concat(second)