diff mbox series

[OSSTEST,05/12] show_abs_time: Represent undef $timet as <undef>

Message ID 20200825114041.16290-6-ian.jackson@eu.citrix.com (mailing list archive)
State New, archived
Headers show
Series Miscellaneous cleanups | expand

Commit Message

Ian Jackson Aug. 25, 2020, 11:40 a.m. UTC
This can happen, for example, if a badly broken flight has steps which
are STARTING and have NULL in the start time column, and is then
reported using sg-report-flight.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 Osstest.pm | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/Osstest.pm b/Osstest.pm
index b2b6b741..734c0ef6 100644
--- a/Osstest.pm
+++ b/Osstest.pm
@@ -457,6 +457,7 @@  sub visible_undef ($) {
 
 sub show_abs_time ($) {
     my ($timet) = @_;
+    return '<undef>' unless defined $timet;
     return strftime "%Y-%m-%d %H:%M:%S Z", gmtime $timet;
 }