From 4e825691fcd639ac5cc4e8408ac0c2cc5efd24e4 Mon Sep 17 00:00:00 2001 From: Nigel Horne Date: Tue, 12 Nov 2024 09:12:43 -0500 Subject: [PATCH] Only get nextlocation when needed --- gedcom | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gedcom b/gedcom index 672684a..2661c4f 100755 --- a/gedcom +++ b/gedcom @@ -11437,9 +11437,10 @@ sub get_all_residences my $nextnextplace = place({ person => $person, record => $nextnext, nopreposition => 1 }); if(defined($nextnextplace) && ($nextnextplace eq $place) && ($nextplace ne $place)) { my @locations = get_location($place); - my @nextlocations = get_location($nextplace); if(my $location = shift @locations) { + my @nextlocations = get_location($nextplace); + if((ref($location) eq 'Geo::Location::Point') && (my $nextlocation = shift @nextlocations)) { if(ref($nextlocation) eq 'Geo::Location::Point') { if($location->distance($nextlocation)->mile() >= 30.0) {