summaryrefslogtreecommitdiff
path: root/fs_selfservice
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2015-06-04 11:23:10 -0700
committerIvan Kohler <ivan@freeside.biz>2015-06-04 11:23:10 -0700
commit0592d8e1ad7c8cab286b43743765fd1435cfac84 (patch)
treeb06bedbe9f11d3dc625713bbe253de613c695813 /fs_selfservice
parent80879cb478cf28d90b3abb8a26bca29ad3a3f3b1 (diff)
don't display a non-sensical duration for open sessions, RT#34966
Diffstat (limited to 'fs_selfservice')
-rw-r--r--fs_selfservice/FS-SelfService/cgi/view_usage_details.html4
1 files changed, 3 insertions, 1 deletions
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 .= '</TD><TD ALIGN="right">';
$OUT .= Date::Format::time2str('%T%P %a&nbsp;%b&nbsp;%o&nbsp;%Y', $usage->{'acctstarttime'});
$OUT .= '</TD><TD ALIGN="right">';
- 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));