Date::Calc::CalcDays was throwing error 500 when one serial had an undefined date.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
my ($res) = $sth->fetchrow ;
return 0 unless $res;
my @res=split (/-/,$res);
-# warn "date expiration :$expirationdate";
my @endofsubscriptiondate=split(/-/,$expirationdate);
+ map{
+ return 2 unless $_ ;
+ } (@res,@endofsubscriptiondate);
return 1 if ( (@endofsubscriptiondate && Delta_Days($res[0],$res[1],$res[2],
$endofsubscriptiondate[0],$endofsubscriptiondate[1],$endofsubscriptiondate[2]) <= 0)
|| (!$res));