Journeys->get_latest: Fix uninitialized value warning

This commit is contained in:
Birte Kristina Friesel 2023-07-14 18:48:46 +02:00
parent 882d1fe16f
commit ca3cd1580f
No known key found for this signature in database
GPG key ID: 19E6E524EBB177BA

View file

@ -709,12 +709,14 @@ sub get_latest {
}
)->expand->hash;
$latest_successful->{visibility_str}
= $latest_successful->{visibility}
? $visibility_itoa{ $latest_successful->{visibility} }
: 'default';
$latest_successful->{effective_visibility_str}
= $visibility_itoa{ $latest_successful->{effective_visibility} };
if ($latest_successful) {
$latest_successful->{visibility_str}
= $latest_successful->{visibility}
? $visibility_itoa{ $latest_successful->{visibility} }
: 'default';
$latest_successful->{effective_visibility_str}
= $visibility_itoa{ $latest_successful->{effective_visibility} };
}
my $latest = $db->select(
'journeys_str',
@ -728,12 +730,14 @@ sub get_latest {
}
)->expand->hash;
$latest->{visibility_str}
= $latest->{visibility}
? $visibility_itoa{ $latest->{visibility} }
: 'default';
$latest->{effective_visibility_str}
= $visibility_itoa{ $latest->{effective_visibility} };
if ($latest) {
$latest->{visibility_str}
= $latest->{visibility}
? $visibility_itoa{ $latest->{visibility} }
: 'default';
$latest->{effective_visibility_str}
= $visibility_itoa{ $latest->{effective_visibility} };
}
return ( $latest_successful, $latest );
}