fix: accountList: crash in some cases

This commit is contained in:
Stéphane Lesimple 2023-06-12 08:11:44 +00:00 committed by Stéphane Lesimple
parent 340ebd0bec
commit f77b8a25d3

View file

@ -146,7 +146,7 @@ foreach my $account (sort keys %$accounts) {
$states{'last_activity'} = undef;
$states{'last_activity_timestamp'} = undef;
my $seconds = $fnret->value->{'seconds'};
my $seconds = ($fnret->value ? $fnret->value->{'seconds'} : undef);
if (defined $seconds) {
$fnret = OVH::Bastion::duration2human(seconds => $seconds, tense => "past");
if ($fnret) {