Skip to content
Snippets Groups Projects
Commit 5e6476a3 authored by Joaquim Casals Buñuel's avatar Joaquim Casals Buñuel
Browse files

Change assertions for nullptr if/else checks

Change the assertions so that we can run the visualizer
on a thread and handle incomplete information cases.
parent dae47f89
No related branches found
No related tags found
No related merge requests found
Pipeline #5890 passed
......@@ -151,20 +151,23 @@ void FactorBase::remove(bool viral_remove_empty_parent)
CaptureBasePtr FactorBase::getCapture() const
{
assert(getFeature() != nullptr && "calling getCapture before linking with a feature");
return getFeature()->getCapture();
auto ftr = getFeature();
if (ftr != nullptr) return ftr->getCapture();
else return nullptr;
}
FrameBasePtr FactorBase::getFrame() const
{
assert(getCapture() != nullptr && "calling getFrame before linking with a capture");
return getCapture()->getFrame();
auto cpt = getCapture();
if(cpt != nullptr) return cpt->getFrame();
else return nullptr;
}
SensorBasePtr FactorBase::getSensor() const
{
assert(getCapture() != nullptr && "calling getSensor before linking with a capture");
return getCapture()->getSensor();
auto cpt = getCapture();
if(cpt != nullptr) return cpt->getSensor();
else return nullptr;
}
void FactorBase::setStatus(FactorStatus _status)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment