i3pystatus/ice-status.py: fix error when seconds is None

As recommended by vonbirne in #2
This commit is contained in:
Franzi 2021-12-09 10:44:58 +01:00
parent 239d003192
commit 88ed4d22f0
Signed by: kunsi
GPG Key ID: 12E3D2136B818350
1 changed files with 2 additions and 0 deletions

View File

@ -8,6 +8,8 @@ from sys import exit
# bundlewrap.utils.text.format_duration, but trimmed down
def format_time(seconds):
if seconds is None:
return "?"
components = []
if seconds >= 3600:
hours = int(seconds / 3600)