From 850f7e02ff0ca9f3514989d7d6c2a0ab96ac4e06 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 27 Apr 2022 13:50:36 -0700 Subject: restore correct workflow when no census match is found: offer map-based picker, RT#86245, RT#76968 --- FS/FS/Misc/Geo.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'FS') diff --git a/FS/FS/Misc/Geo.pm b/FS/FS/Misc/Geo.pm index 3beffc8a9..6f923f595 100644 --- a/FS/FS/Misc/Geo.pm +++ b/FS/FS/Misc/Geo.pm @@ -166,9 +166,11 @@ sub get_censustract_uscensus { warn Dumper($content) if $DEBUG; - if ( $content->{result}->{addressMatches} ) { + my $addressMatches_ref = $content->{result}->{addressMatches}; - my $tract = $content->{result}->{addressMatches}[0]->{geographies}->{'Census Blocks'}[0]->{GEOID}; + if ( $addressMatches_ref && scalar @{$addressMatches_ref} ) { + + my $tract = $addressMatches_ref->[0]->{geographies}->{'Census Blocks'}[0]->{GEOID}; return $tract; } else { -- cgit v1.2.1