mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
navigator: check _navigation_mode_array before run
This commit is contained in:
@@ -710,7 +710,9 @@ Navigator::run()
|
|||||||
|
|
||||||
/* iterate through navigation modes and set active/inactive for each */
|
/* iterate through navigation modes and set active/inactive for each */
|
||||||
for (unsigned int i = 0; i < NAVIGATOR_MODE_ARRAY_SIZE; i++) {
|
for (unsigned int i = 0; i < NAVIGATOR_MODE_ARRAY_SIZE; i++) {
|
||||||
_navigation_mode_array[i]->run(_navigation_mode == _navigation_mode_array[i]);
|
if (_navigation_mode_array[i]) {
|
||||||
|
_navigation_mode_array[i]->run(_navigation_mode == _navigation_mode_array[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if nothing is running, set position setpoint triplet invalid once */
|
/* if nothing is running, set position setpoint triplet invalid once */
|
||||||
|
|||||||
Reference in New Issue
Block a user