utils: check that the object is a hash when merging default_proc

Follow-up to #5026.
This commit is contained in:
Parker Moore 2016-06-22 12:15:07 -07:00
parent 357e3621e2
commit 9278eb8fce
No known key found for this signature in database
GPG Key ID: 193CDEBA72063C58
1 changed files with 1 additions and 6 deletions

View File

@ -302,16 +302,11 @@ module Jekyll
private
def merge_default_proc(target, overwrite)
if default_proc?(target) && default_proc?(overwrite) && target.default_proc.nil?
if target.is_a?(Hash) && overwrite.is_a?(Hash) && target.default_proc.nil?
target.default_proc = overwrite.default_proc
end
end
private
def default_proc?(object)
object.respond_to?(:default_proc)
end
private
def duplicate_frozen_values(target)
target.each do |key, val|