[OSSTEST PATCH 06/82] show_abs_time: Represent undef $timet as <undef>

Ian Jackson posted 82 patches 5 years ago
[OSSTEST PATCH 06/82] show_abs_time: Represent undef $timet as <undef>
Posted by Ian Jackson 5 years ago
From: Ian Jackson <ian.jackson@eu.citrix.com>

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 --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;
 }
 
-- 
2.20.1