mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-09 09:28:31 -04:00
ArduCopter: Check for nullptr for motors class pointer
Because of added initialisation of UAVCAN send_heartbeat function starts before motors initialisation. So we need check is object created.
This commit is contained in:
parent
e0acbd3e53
commit
8accfb97f6
@ -70,7 +70,7 @@ NOINLINE void Copter::send_heartbeat(mavlink_channel_t chan)
|
||||
#endif
|
||||
|
||||
// we are armed if we are not initialising
|
||||
if (motors->armed()) {
|
||||
if (motors != nullptr && motors->armed()) {
|
||||
base_mode |= MAV_MODE_FLAG_SAFETY_ARMED;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user