check if the reporter is initialized

This commit is contained in:
Sven Czarnian
2021-08-19 08:21:53 +02:00
parent eb05256df7
commit c6677761dd

View File

@@ -126,8 +126,8 @@ aman::Aircraft* PlugIn::generateAircraftMessage(const EuroScopePlugIn::CRadarTar
}
void PlugIn::OnRadarTargetPositionUpdate(EuroScopePlugIn::CRadarTarget radarTarget) {
/* ignore invalid targets */
if (false == radarTarget.IsValid())
/* do nothing if the reporter is not initialized and ignore invalid targets */
if (false == AircraftReporter::instance().initialized() || false == radarTarget.IsValid())
return;
auto flightPlan = radarTarget.GetCorrelatedFlightPlan();