diff --git a/taky/cot/models/takuser.py b/taky/cot/models/takuser.py index 49e9dd8..8d083e3 100644 --- a/taky/cot/models/takuser.py +++ b/taky/cot/models/takuser.py @@ -94,8 +94,12 @@ def from_elm(elm, uid): elif d_elm.tag == "status": ret.battery = d_elm.get("battery") elif d_elm.tag == "track": - ret.course = float(d_elm.get("course")) - ret.speed = float(d_elm.get("speed")) + course_attr = d_elm.get("course") + speed_attr = d_elm.get("speed") + if course_attr != None: + ret.course = float(course_attr) + if speed_attr != None: + ret.speed = float(speed_attr) return ret