From b39134bec1fade37ce9f55d1759c0b5a461215f2 Mon Sep 17 00:00:00 2001 From: Dan Milne Date: Mon, 14 Oct 2019 11:35:20 +1100 Subject: [PATCH] More comprehensive handling of failed date parsing --- lib/paapi/item.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/paapi/item.rb b/lib/paapi/item.rb index f9a194b..a8ce38d 100644 --- a/lib/paapi/item.rb +++ b/lib/paapi/item.rb @@ -42,12 +42,12 @@ module Paapi def publication_date d = get(%w{ItemInfo ContentInfo PublicationDate DisplayValue}) - return d.nil? ? nil : Date.parse(d) + return Date.parse(d) rescue nil end def release_date d = get(%w{ItemInfo ProductInfo ReleaseDate DisplayValue}) - return d.nil? ? nil : Date.parse(d) + return Date.parse(d) rescue nil end def contributors