Skip to content

Commit c5bb44e

Browse files
GCS_MAVLink: check airspeed is enabled before trying to calibrate
1 parent 252ee8f commit c5bb44e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/GCS_MAVLink/GCS_Common.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4776,7 +4776,7 @@ MAV_RESULT GCS_MAVLINK::_handle_command_preflight_calibration_baro(const mavlink
47764776
#if AP_AIRSPEED_ENABLED
47774777

47784778
AP_Airspeed *airspeed = AP_Airspeed::get_singleton();
4779-
if (airspeed != nullptr) {
4779+
if (airspeed != nullptr && airspeed->enabled()) {
47804780
GCS_MAVLINK_InProgress *task = GCS_MAVLINK_InProgress::get_task(MAV_CMD_PREFLIGHT_CALIBRATION, GCS_MAVLINK_InProgress::Type::AIRSPEED_CAL, msg.sysid, msg.compid, chan);
47814781
if (task == nullptr) {
47824782
return MAV_RESULT_TEMPORARILY_REJECTED;

0 commit comments

Comments
 (0)