diff --git a/src/processor_motion.cpp b/src/processor_motion.cpp index e17c407c9f6a127d2f2ad73dd8d3e7751a8f918a..0cbdd2863930306a61213126f905714f60d0a6f7 100644 --- a/src/processor_motion.cpp +++ b/src/processor_motion.cpp @@ -35,7 +35,11 @@ ProcessorMotion::~ProcessorMotion() void ProcessorMotion::process(CaptureBasePtr _incoming_ptr) { - + if (_incoming_ptr == nullptr) + { + WOLF_ERROR("Process got a nullptr !"); + return; + } if (status_ == IDLE) { diff --git a/src/sensor_base.h b/src/sensor_base.h index 9b8bd4e6fbd02a545b66fc4868cdc85ed995465f..b68585d6ff24b7606d0094b588ded87e9785ef15 100644 --- a/src/sensor_base.h +++ b/src/sensor_base.h @@ -256,6 +256,8 @@ inline void SensorBase::setHardwarePtr(const HardwareBasePtr _hw_ptr) inline bool SensorBase::process(const CaptureBasePtr capture_ptr) { + if (capture_ptr == nullptr) return false; + capture_ptr->setSensorPtr(shared_from_this()); for (const auto processor : processor_list_)