mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
RangeFinder: fixed a crash when VL53L0X was enabled in the software but not connected.
This commit is contained in:
parent
776d5e6ba3
commit
8fa281fa5b
@ -228,6 +228,9 @@ AP_RangeFinder_VL53L0X::AP_RangeFinder_VL53L0X(RangeFinder::RangeFinder_State &_
|
||||
*/
|
||||
AP_RangeFinder_Backend *AP_RangeFinder_VL53L0X::detect(RangeFinder::RangeFinder_State &_state, AP_HAL::OwnPtr<AP_HAL::I2CDevice> dev)
|
||||
{
|
||||
if(!dev){
|
||||
return nullptr;
|
||||
}
|
||||
AP_RangeFinder_VL53L0X *sensor
|
||||
= new AP_RangeFinder_VL53L0X(_state, std::move(dev));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user