diff options
author | Ivan Kohler <ivan@freeside.biz> | 2022-04-27 13:50:36 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2022-04-27 13:50:36 -0700 |
commit | 850f7e02ff0ca9f3514989d7d6c2a0ab96ac4e06 (patch) | |
tree | c42f601e8ba2bc6faf2d108e714ea1f14995be6f /FS | |
parent | bf9b266acafce57cfa532801c00d45dc4eab765c (diff) |
restore correct workflow when no census match is found: offer map-based picker, RT#86245, RT#76968
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/Misc/Geo.pm | 6 |
1 files changed, 4 insertions, 2 deletions
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 { |