diff --git a/waybar/waybar-weather.pl b/waybar/waybar-weather.pl index 5c67f86..a7d39d4 100755 --- a/waybar/waybar-weather.pl +++ b/waybar/waybar-weather.pl @@ -37,7 +37,7 @@ my $ref = $json->decode($ret->{_content}); if ($cmd eq 'bar') { my $temp = $ref->{current}->{temp} - 273.15; - my $icon = $ref->{current}->{weather}->[0]->{icon}; + my $icon = $ref->{current}->{weather}->[0]->{icon} //= '?'; printf("%s%.1f%s", $icons{$icon}, ${temp}, "°C"); } elsif ($cmd eq 'notify') {