Skip to content

Commit

Permalink
fakegps: avoid None-doesn't-have-attribute error
Browse files Browse the repository at this point in the history
'NoneType' object has no attribute 'mav'
Traceback (most recent call last):
  File "/home/pbarker/.local/lib/python3.6/site-packages/MAVProxy-1.8.48-py3.6.egg/EGG-INFO/scripts/mavproxy.py", line 1023, in periodic_tasks
  File "/home/pbarker/.local/lib/python3.6/site-packages/MAVProxy-1.8.48-py3.6.egg/MAVProxy/modules/mavproxy_fakegps.py", line 92, in idle_task
    self.master.mav.gps_input_send(time_us, 0, 0, gps_week_ms, gps_week, fix_type,
AttributeError: 'NoneType' object has no attribute 'mav'
  • Loading branch information
peterbarker committed Mar 25, 2022
1 parent 36d69ef commit c1e98c7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions MAVProxy/modules/mavproxy_fakegps.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ def get_gps_time(self, tnow):

def idle_task(self):
'''called on idle'''
if self.master is None:
return
now = time.time()
if now - self.last_send < 1.0 / self.FakeGPS_settings.rate:
return
Expand Down

0 comments on commit c1e98c7

Please sign in to comment.