From f77b8a25d3ce1cf7eb1a8becbf869a9d402afc85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lesimple?= Date: Mon, 12 Jun 2023 08:11:44 +0000 Subject: [PATCH] fix: accountList: crash in some cases --- bin/plugin/restricted/accountList | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/plugin/restricted/accountList b/bin/plugin/restricted/accountList index 24bfd6d..7905035 100755 --- a/bin/plugin/restricted/accountList +++ b/bin/plugin/restricted/accountList @@ -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) {