From e2ed107ad2990db03f9c4cec45b2aa5b7141bffe Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Sat, 12 Jun 2010 22:51:49 +1200 Subject: [PATCH] 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. --- bin/mythtv-status | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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'}; -- 2.30.2