Commit e6648c06 authored by Don Gagne's avatar Don Gagne

Merge pull request #3135 from DonLakeFlyer/NullActive

Fix null _activeVehicle references
parents e68c93dc 2d49ef53
......@@ -445,25 +445,25 @@ Item {
spacing: _margins
QGCButton {
text: _activeVehicle.armed ? (_activeVehicle.flying ? "Emergency Stop" : "Disarm") : "Arm"
text: (_activeVehicle && _activeVehicle.armed) ? (_activeVehicle.flying ? "Emergency Stop" : "Disarm") : "Arm"
onClicked: _guidedModeBar.confirmAction(_activeVehicle.armed ? (_activeVehicle.flying ? _guidedModeBar.confirmEmergencyStop : _guidedModeBar.confirmDisarm) : _guidedModeBar.confirmArm)
}
QGCButton {
text: "RTL"
visible: _activeVehicle.guidedModeSupported && _activeVehicle.flying
visible: _activeVehicle && _activeVehicle.guidedModeSupported && _activeVehicle.flying
onClicked: _guidedModeBar.confirmAction(_guidedModeBar.confirmHome)
}
QGCButton {
text: _activeVehicle.flying ? "Land" : "Takeoff"
visible: _activeVehicle.guidedModeSupported && _activeVehicle.armed
text: (_activeVehicle && _activeVehicle.flying) ? "Land" : "Takeoff"
visible: _activeVehicle && _activeVehicle.guidedModeSupported && _activeVehicle.armed
onClicked: _guidedModeBar.confirmAction(_activeVehicle.flying ? _guidedModeBar.confirmLand : _guidedModeBar.confirmTakeoff)
}
QGCButton {
text: "Pause"
visible: _activeVehicle.pauseVehicleSupported && _activeVehicle.flying
visible: _activeVehicle && _activeVehicle.pauseVehicleSupported && _activeVehicle.flying
onClicked: {
guidedModeHideTimer.restart()
_activeVehicle.pauseVehicle()
......@@ -472,13 +472,14 @@ Item {
QGCButton {
text: "Change Altitude"
visible: _activeVehicle.guidedModeSupported && _activeVehicle.armed
visible: _activeVehicle && _activeVehicle.guidedModeSupported && _activeVehicle.armed
onClicked: _guidedModeBar.confirmAction(_guidedModeBar.confirmChangeAlt)
}
} // Row
QGCLabel {
anchors.horizontalCenter: parent.horizontalCenter
color: qgcPal.button
text: "Click in map to move vehicle"
visible: _activeVehicle && _activeVehicle.guidedMode && _activeVehicle.flying
}
......
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