Escape IA if no parent_era has been found

master
rgaul 2016-05-26 23:51:21 +00:00
parent b81101f1e3
commit 4774611756
2 changed files with 5 additions and 1 deletions

View File

@ -31,6 +31,9 @@ handle query_parts => sub {
my $era_year = $3;
my $parent_era = $year_map_with_aliases{$era_name};
return unless $parent_era;
my $era_hash = $year_definitions->{$parent_era};
my $gregorian_year_started = $era_hash->{'gregorian_year_started'};

View File

@ -78,7 +78,8 @@ ddg_goodie_test(
'meiji 2 45645' => test_zci(
'Meiji 2 is equivalent to 1869 AD in the Gregorian Calendar',
make_structured_answer('Meiji', '2', '1869', 'AD')
)
),
'bengali calendar 423' => undef
);
sub make_structured_answer {