Skip to content

Commit

Permalink
Merge pull request #4539 from DonLakeFlyer/Copter3.5Crash
Browse files Browse the repository at this point in the history
Prevent crash from missing FRAME param
  • Loading branch information
DonLakeFlyer authored Feb 14, 2017
2 parents 4a25648 + d7be080 commit 59f8948
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/AutoPilotPlugins/APM/APMAirframeComponentController.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@ APMAirframeComponentController::APMAirframeComponentController(void) :
_fillAirFrames();

Fact *frame = getParameterFact(FactSystem::defaultComponentId, QStringLiteral("FRAME"));
connect(frame, &Fact::vehicleUpdated, this, &APMAirframeComponentController::_factFrameChanged);
_factFrameChanged(frame->rawValue());
if (frame) {
// Not available in newer firmwares, requires newer QGC to run correctly
connect(frame, &Fact::vehicleUpdated, this, &APMAirframeComponentController::_factFrameChanged);
_factFrameChanged(frame->rawValue());
}
}

APMAirframeComponentController::~APMAirframeComponentController()
Expand Down
2 changes: 1 addition & 1 deletion src/QGCApplication.cc
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ void QGCApplication::_missingParamsDisplay(void)
}
_missingParams.clear();

showMessage(QString("Parameters missing from firmware: %1. You may be running an older version of firmware QGC does not work correctly with or your firmware has a bug in it.").arg(params));
showMessage(QString("Parameters missing from firmware: %1. You may be running a version of firmware QGC does not work correctly with or your firmware has a bug in it.").arg(params));
}

QObject* QGCApplication::_rootQmlObject()
Expand Down

0 comments on commit 59f8948

Please sign in to comment.