From: Andrew Ruthven Date: Sat, 12 Jun 2010 10:51:49 +0000 (+1200) Subject: Make sure to skip converting units based on thresholds if there is nothing to convert. X-Git-Tag: 0.9.4~3 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2ed107ad2990db03f9c4cec45b2aa5b7141bffe;p=mythtv-status.git Make sure to skip converting units based on thresholds if there is nothing to convert. This gets rid of warnings like: Use of uninitialized value in numeric gt (>) at mythtv-status line 870. --- diff --git a/bin/mythtv-status b/bin/mythtv-status index b42c167..ab6449b 100755 --- a/bin/mythtv-status +++ b/bin/mythtv-status @@ -67,7 +67,7 @@ my @size_thresholds = ( my $return_code_only = 0; -my $VERSION = '0.9.3'; +my $VERSION = '0.9.4'; # Some display blocks are disabled by default: $c->{'display'}{'Shows due to Auto Expire'} = 0; @@ -863,7 +863,7 @@ sub substitute_vars { if (defined $block->{'human_readable_sizes'}) { for my $key (@{ $block->{'human_readable_sizes'}}) { for my $unit (@size_thresholds) { - if (defined $unit->{'threshold'}) { + if (defined $vars->{$key} && defined $unit->{'threshold'}) { if ($vars->{$key} > $unit->{'threshold'}) { $vars->{$key} = sprintf("%.1f", $vars->{$key} / $unit->{'conversion'}); $vars->{"${key}_unit"} = $unit->{'unit'};