Skip to content

Commit 344fe93

Browse files
authored
Merge pull request #708 from thde/patch-1
fix merge nil hashes
2 parents 1e296b7 + 0969e02 commit 344fe93

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/puppet/type/concat_file.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,9 @@ def should_content
264264
end
265265

266266
def nested_merge(hash1, hash2)
267-
# If a hash is empty, simply return the other
268-
return hash1 if hash2.empty?
269-
return hash2 if hash1.empty?
267+
# If a hash is nil or empty, simply return the other
268+
return hash1 if hash2.nil? || hash2.empty?
269+
return hash2 if hash1.nil? || hash1.empty?
270270

271271
# Unique merge for arrays
272272
if hash1.is_a?(Array) && hash2.is_a?(Array)

0 commit comments

Comments
 (0)