bug fix when queue has no message (#2451)

This commit is contained in:
matoy 2020-12-23 08:57:03 +01:00 committed by GitHub
parent de114dbe3f
commit add3f87bc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -147,9 +147,11 @@ sub manage_selection {
push @{$self->{raw_results}->{$queue->{queueId}}->{$message_type}}, $values->{value};
$total_value += $values->{value};
}
my $points = scalar(@{$self->{raw_results}->{$queue->{queueId}}->{$message_type}});
if ($self->{raw_results}->{$queue->{queueId}}->{$message_type}) {
my $points = scalar(@{$self->{raw_results}->{$queue->{queueId}}->{$message_type}});
$self->{raw_results}->{$queue->{queueId}}{$message_type} = $total_value / $points;
$self->{raw_results}->{$queue->{queueId}}{$message_type} = $total_value / $points;
}
}
$self->{queues}->{$queue->{queueId}} = {