Do not dump undumpable objects (#7190)

Merge pull request 7190
This commit is contained in:
Pat Hawks 2018-10-02 06:27:15 -05:00 committed by jekyllbot
parent 28cb55c455
commit 139ea09967
1 changed files with 3 additions and 0 deletions

View File

@ -60,7 +60,10 @@ module Jekyll
return unless @@disk_cache_enabled
path = path_to(hash(key))
value = new Hash(value) if value.is_a?(Hash) && !value.default.nil?
dump(path, value)
rescue TypeError
Jekyll.logger.debug "Cache:", "Cannot dump object #{key}"
end
# If an item already exists in the cache, retrieve it