Browse Source

Fix incorrect reference to vehicle causing crash

QGC4.4
Don Gagne 6 years ago
parent
commit
c7d0eb7557
  1. 6
      src/MissionManager/MissionCommandTree.cc

6
src/MissionManager/MissionCommandTree.cc

@ -223,11 +223,15 @@ QVariantList MissionCommandTree::getCommandsForCategory(Vehicle* vehicle, const @@ -223,11 +223,15 @@ QVariantList MissionCommandTree::getCommandsForCategory(Vehicle* vehicle, const
{
MAV_AUTOPILOT baseFirmwareType;
MAV_TYPE baseVehicleType;
QList<MAV_CMD> supportedCommands = vehicle->firmwarePlugin()->supportedMissionCommands();
_baseVehicleInfo(vehicle, baseFirmwareType, baseVehicleType);
_buildAllCommands(vehicle);
// vehicle can be null in which case _baseVehicleInfo will tell of the firmware/vehicle type for the offline editing vehicle.
// We then use that to get a firmware plugin so we can get the list of supported commands.
FirmwarePlugin* firmwarePlugin = qgcApp()->toolbox()->firmwarePluginManager()->firmwarePluginForAutopilot(baseFirmwareType, baseVehicleType);
QList<MAV_CMD> supportedCommands = firmwarePlugin->supportedMissionCommands();
QVariantList list;
QMap<MAV_CMD, MissionCommandUIInfo*> commandMap = _allCommands[baseFirmwareType][baseVehicleType];
for (MAV_CMD command: commandMap.keys()) {

Loading…
Cancel
Save