From 2bdd638cefd1f0c65ffe2a4f3513ab9e20fd14aa Mon Sep 17 00:00:00 2001 From: Junzi Sun Date: Fri, 14 Aug 2020 23:50:54 +0200 Subject: [PATCH] bug fix in is60() --- pyModeS/decoder/bds/bds60.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pyModeS/decoder/bds/bds60.py b/pyModeS/decoder/bds/bds60.py index e5749cd..74255db 100644 --- a/pyModeS/decoder/bds/bds60.py +++ b/pyModeS/decoder/bds/bds60.py @@ -58,9 +58,10 @@ def is60(msg): # additional check knowing altitude if (mach is not None) and (ias is not None) and (common.df(msg) == 20): alt = common.altcode(msg) - ias_ = aero.mach2cas(mach, alt * aero.ft) / aero.kts - if abs(ias - ias_) > 20: - return False + if alt is not None: + ias_ = aero.mach2cas(mach, alt * aero.ft) / aero.kts + if abs(ias - ias_) > 20: + return False return True