Browse Source

AP_DAL: correct rangefinder get_backend range check

zr-v5.1
Peter Barker 4 years ago committed by Andrew Tridgell
parent
commit
54bae68e02
  1. 5
      libraries/AP_DAL/AP_DAL_RangeFinder.cpp

5
libraries/AP_DAL/AP_DAL_RangeFinder.cpp

@ -116,7 +116,10 @@ bool AP_DAL_RangeFinder::has_orientation(enum Rotation orientation) const @@ -116,7 +116,10 @@ bool AP_DAL_RangeFinder::has_orientation(enum Rotation orientation) const
AP_DAL_RangeFinder_Backend *AP_DAL_RangeFinder::get_backend(uint8_t id) const
{
if (id >= RANGEFINDER_MAX_INSTANCES) {
INTERNAL_ERROR(AP_InternalError::error_t::flow_of_control);
INTERNAL_ERROR(AP_InternalError::error_t::flow_of_control);
return nullptr;
}
if (id >= _RRNH.num_sensors) {
return nullptr;
}

Loading…
Cancel
Save