Skip to content

Commit

Permalink
mavparm: only look for 0x in strings
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed Jan 24, 2024
1 parent e2a7e74 commit 35bc0c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mavparm.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def mavset(self, mav, name, value, retries=3, parm_type=None):
return False
numeric_value, = struct.unpack(">f", vstr)
else:
if value.lower().startswith('0x'):
if isinstance(value, str) and value.lower().startswith('0x'):
numeric_value = int(value[2:], 16)
else:
numeric_value = float(value)
Expand Down

0 comments on commit 35bc0c1

Please sign in to comment.