Commits

Guillaume Libersat  committed ed3ec1e

protect if initial timedelta is None

  • Participants
  • Parent commits 1913215

Comments (0)

Files changed (1)

File timedelta/widgets.py

         if initial in ["", None] and data in ["", None]:
             return False
         
-        if not isinstance(initial, datetime.timedelta):
-            initial = parse(initial)
+        if initial:
+            if not isinstance(initial, datetime.timedelta):
+                initial = parse(initial)
+
         if not isinstance(data, datetime.timedelta):
             data = parse(data)
         
-        return initial != data
+        return initial != data