Commit 992b3a5a authored by Don Gagne's avatar Don Gagne

Fix vehicle switch crash

parent 4aff4121
......@@ -150,17 +150,17 @@ MavCmdInfo* MissionCommands::getMavCmdInfo(MAV_CMD command, Vehicle* vehicle) co
if (vehicle) {
if (vehicle->fixedWing()) {
if (_autopilotToFixedWingMissionCommands[firmwareType]->contains(command)) {
if (_autopilotToFixedWingMissionCommands.contains(firmwareType) && _autopilotToFixedWingMissionCommands[firmwareType]->contains(command)) {
mavCmdInfo = _autopilotToFixedWingMissionCommands[firmwareType]->getMavCmdInfo(command);
}
} else if (vehicle->multiRotor()) {
if (_autopilotToMultiRotorMissionCommands[firmwareType]->contains(command)) {
if (_autopilotToMultiRotorMissionCommands.contains(firmwareType) && _autopilotToMultiRotorMissionCommands[firmwareType]->contains(command)) {
mavCmdInfo = _autopilotToMultiRotorMissionCommands[firmwareType]->getMavCmdInfo(command);
}
}
}
if (!mavCmdInfo && _autopilotToCommonMissionCommands[firmwareType]->contains(command)) {
if (!mavCmdInfo && _autopilotToCommonMissionCommands.contains(firmwareType) && _autopilotToCommonMissionCommands[firmwareType]->contains(command)) {
mavCmdInfo = _autopilotToCommonMissionCommands[firmwareType]->getMavCmdInfo(command);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment