Bug 34838: Only call strings_map if status_alias is not undef in status_alias cycle

Because its highly likely that at least one request will have status_alias null in the database, the select MAX query will always return at least one result with NULL status_alias, throwing a warning, so we skip that

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 4231def42e)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Pedro Amorim 2023-09-26 09:33:08 +00:00 committed by Lucas Gass
parent 6909c637bd
commit 804f8b4fbb
1 changed files with 2 additions and 2 deletions

View File

@ -89,9 +89,9 @@ sub existing_statuses {
}
);
while ( my $request = $ill_requests->next ) {
my $status_data = $request->strings_map;
my $status_data = $request->status_alias ? $request->strings_map : undef;
if ( $status_data->{status_alias} ) {
if ( $status_data && $status_data->{status_alias} ) {
push @data, {
$status_data->{status_alias}->{str} ? ( str => $status_data->{status_alias}->{str} )
: $status_data->{status_alias}->{code} ? ( str => $status_data->{status_alias}->{code} )