diff mbox

[1/2] sg-report-flight: Do not try to print nonexistent FirstTip info

Message ID 1492693645-4714-1-git-send-email-ian.jackson@eu.citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ian Jackson April 20, 2017, 1:07 p.m. UTC
The use of $info->{FirstTip}{flight} autovivifies $info->{FirstTip}.
Defend $pinfo against the use of an autovivified empty hashref.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 sg-report-flight |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/sg-report-flight b/sg-report-flight
index 7d2bc66..5b8f67a 100755
--- a/sg-report-flight
+++ b/sg-report-flight
@@ -586,7 +586,7 @@  sub print_pushgate_summary () {
 	my $f = $info->{$flightkey};
 	my $count = $info->{$countkey};
 	bodyprintf "%-20s", $what;
-	if ($f) {
+	if ($f && %$f) {
 	    bodyprintf(" %6d  %s %4d days",
 		   $f->{flight},
 		   show_abs_time($f->{started}),