From add3f87bc1382334ccc37ffdce23ca2f8805657a Mon Sep 17 00:00:00 2001 From: matoy Date: Wed, 23 Dec 2020 08:57:03 +0100 Subject: [PATCH] bug fix when queue has no message (#2451) --- apps/mulesoft/restapi/mode/messages.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/mulesoft/restapi/mode/messages.pm b/apps/mulesoft/restapi/mode/messages.pm index 91be01b5f..a3b339983 100644 --- a/apps/mulesoft/restapi/mode/messages.pm +++ b/apps/mulesoft/restapi/mode/messages.pm @@ -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}} = {