From 0592d8e1ad7c8cab286b43743765fd1435cfac84 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Thu, 4 Jun 2015 11:23:10 -0700 Subject: [PATCH] don't display a non-sensical duration for open sessions, RT#34966 --- fs_selfservice/FS-SelfService/cgi/view_usage_details.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs_selfservice/FS-SelfService/cgi/view_usage_details.html b/fs_selfservice/FS-SelfService/cgi/view_usage_details.html index 0388c2fad..27afe12a7 100644 --- a/fs_selfservice/FS-SelfService/cgi/view_usage_details.html +++ b/fs_selfservice/FS-SelfService/cgi/view_usage_details.html @@ -47,7 +47,9 @@ $OUT .= ''; $OUT .= Date::Format::time2str('%T%P %a %b %o %Y', $usage->{'acctstarttime'}); $OUT .= ''; - my $duration = $usage->{'acctstoptime'} - $usage->{'acctstarttime'}; + my $duration = ( $usage->{'acctstoptime'} && $usage->{'acctstarttime'} ) + ? ( $usage->{'acctstoptime'} - $usage->{'acctstarttime'} ) + : 0; $total += $duration; my $h = int($duration/3600); my $m = sprintf("%02d", int(($duration % 3600) / 60)); -- 2.11.0