diff --git a/oxlib/format.py b/oxlib/format.py index be7a826..cf7b102 100644 --- a/oxlib/format.py +++ b/oxlib/format.py @@ -174,6 +174,8 @@ def formatDuration(ms, verbosity=0, years=True, hours=True, milliseconds=True): >>> formatDuration(1000 * 30, hours=False, milliseconds=False) '00:30' ''' + if not ms: + return '' if years: y = int(ms / 31536000000) d = int(ms % 31536000000 / 86400000)