diff --git a/lib/Geo/Coder/List.pm b/lib/Geo/Coder/List.pm index f0325c7..b52724b 100644 --- a/lib/Geo/Coder/List.pm +++ b/lib/Geo/Coder/List.pm @@ -407,6 +407,10 @@ sub geocode { print 'Number of matches from ', ref($geocoder), ': ', scalar(@rc), "\n" if($self->{'debug'}); print Data::Dumper->new([\@rc])->Dump() if($self->{'debug'} >= 2); if(defined($rc[0])) { # check it's not an empty hash + if((!defined($rc[0]->{lat})) || (!defined($rc[0]->{lng}))) { + ::diag(Data::Dumper->new([\@rc])->Dump()); + Carp::croak("BUG: '$location': HASH exists but is not sensible"); + } if(wantarray) { $self->_cache($location, \@rc); return @rc;