diff --git a/ground/openpilotgcs/src/plugins/scope/scopegadgetwidget.cpp b/ground/openpilotgcs/src/plugins/scope/scopegadgetwidget.cpp index fb2bbf796..dfbd9d614 100644 --- a/ground/openpilotgcs/src/plugins/scope/scopegadgetwidget.cpp +++ b/ground/openpilotgcs/src/plugins/scope/scopegadgetwidget.cpp @@ -385,8 +385,15 @@ void ScopeGadgetWidget::addCurvePlot(QString uavObject, QString uavFieldSubField ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); UAVObjectManager *objManager = pm->getObject(); UAVDataObject* obj = dynamic_cast(objManager->getObject((plotData->uavObject))); - + if(!obj) { + qDebug() << "Object " << plotData->uavObject << " is missing"; + return; + } UAVObjectField* field = obj->getField(plotData->uavField); + if(!field) { + qDebug() << "Field " << plotData->uavField << " of object " << plotData->uavObject << " is missing"; + return; + } QString units = field->getUnits(); if(units == 0)