lib/utensils/custom_matchers.rb in utensils-0.0.5 vs lib/utensils/custom_matchers.rb in utensils-0.0.6

- old
+ new

@@ -92,11 +92,15 @@ def find_dragonfly_image @page.all('img').each do |img| url = img['src'] dragonfly_hash = url[/media\/([^\/.]+)/, 1] if dragonfly_hash - dragonfly_job = Dragonfly::Job.deserialize(dragonfly_hash, Dragonfly[:images]) - return true if dragonfly_job.uid == @image.send(:uid) + begin + dragonfly_job = Dragonfly::Job.deserialize(dragonfly_hash, Dragonfly[:images]) + return true if dragonfly_job.uid == @image.send(:uid) + rescue Dragonfly::Serializer::BadString + continue + end end end return false end end