Skip to content

Commit 5baf480

Browse files
committed
#610: Wrap iterable call in try..except to deal with unrecognised vehicle codes
1 parent f423aff commit 5baf480

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

dronekit/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1521,7 +1521,10 @@ def _mode_mapping_bynumber(self):
15211521
return mavutil.mode_mapping_bynumber(self._vehicle_type)
15221522

15231523
def _is_mode_available(self, mode_code):
1524-
return mode_code in self._mode_mapping_bynumber
1524+
try:
1525+
return mode_code in self._mode_mapping_bynumber
1526+
except:
1527+
return False
15251528

15261529
#
15271530
# Operations to support the standard API.

0 commit comments

Comments
 (0)