Skip to content

Commit

Permalink
Use can rather then ref
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Sep 14, 2024
1 parent f71d7ac commit 234554b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gedcom
Original file line number Diff line number Diff line change
Expand Up @@ -2661,7 +2661,7 @@ sub print_person
}
} else {
foreach my $event(@events) {
if((ref($event) eq 'Gedcom::Record') &&
if(ref($event) && $event->can('type') && defined($event->type()) &&
($event->type() eq 'Custom Marriage')) {
# FindMyPast
$marriage = $event;
Expand Down Expand Up @@ -12211,14 +12211,14 @@ sub get_marriage
$event = $e;
}
}
if($event->can('type') && defined($event->type()) &&
if(ref($event) && $event->can('type') && defined($event->type()) &&
($event->type() eq 'Custom Marriage')) {
# FindMyPast
return $event;
}
} else {
foreach my $event(@events) {
if((ref($event) eq 'Gedcom::Record') &&
if(ref($event) && $event->can('type') && defined($event->type()) &&
($event->type() eq 'Custom Marriage')) {
# FindMyPast
return $event;
Expand Down

0 comments on commit 234554b

Please sign in to comment.