From 139ea099679b96537283a6c154dd219c95afa425 Mon Sep 17 00:00:00 2001 From: Pat Hawks Date: Tue, 2 Oct 2018 06:27:15 -0500 Subject: [PATCH] Do not dump undumpable objects (#7190) Merge pull request 7190 --- lib/jekyll/cache.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/jekyll/cache.rb b/lib/jekyll/cache.rb index abf3610c..66f1d18e 100644 --- a/lib/jekyll/cache.rb +++ b/lib/jekyll/cache.rb @@ -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