From 0ffd106e689f7accd78c6f401f7a56d83bd75a97 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 30 Oct 2022 17:18:47 +0100 Subject: utilization_icon: handle unknown first/second class utilization --- lib/DBInfoscreen.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/DBInfoscreen.pm b/lib/DBInfoscreen.pm index 83cb77a..836f94e 100644 --- a/lib/DBInfoscreen.pm +++ b/lib/DBInfoscreen.pm @@ -240,7 +240,9 @@ sub startup { $self->helper( 'utilization_icon' => sub { my ( $self, $utilization ) = @_; - my ( $first, $second ) = @{ $utilization // [ 0, 0 ] }; + my ( $first, $second ) = @{ $utilization // [] }; + $first //= 0; + $second //= 0; my $sum = ( $first + $second ) / 2; my @symbols -- cgit v1.2.3