Skip to content

Commit

Permalink
Fix uninitialized value
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Nov 16, 2024
1 parent af2adbf commit d98d3bd
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions gedcom
Original file line number Diff line number Diff line change
Expand Up @@ -4200,10 +4200,15 @@ sub print_person
$phrase->append(scalar(@spouses) . i18n(' times'));
}

# Sort the order of the marriages by date
# Sort the marriages by date
my $all_marriages_have_date = 1;
foreach my $spouse(@spouses) {
if(!date_to_datetime(dateofmarriage($spouse))) {
if(my $dom = dateofmarriage($spouse)) {
if(!date_to_datetime($dom)) {
$all_marriages_have_date = 0;
last;
}
} else {
$all_marriages_have_date = 0;
last;
}
Expand Down Expand Up @@ -8444,11 +8449,13 @@ sub all_records_have_date
# Check if the date is valid and matches required format
if((!defined $date) || ($date !~ /^\d/) || ($date =~ /[a-z]$/i) ||
($date =~ /[\/\-]/) || ($date =~ / to /) || !date_parser_cached(date => $date)) {
# Log a warning if date is invalid
complain({
person => $person,
warning => "Record has an invalid date of $date"
});
if(defined($date)) {
# Log a warning if date is invalid
complain({
person => $person,
warning => "Record has an invalid date of $date"
});
}
return 0;
}
}
Expand Down

0 comments on commit d98d3bd

Please sign in to comment.