From: ThorstenB Date: Sat, 22 Sep 2012 12:00:05 +0000 (+0200) Subject: Fix NavDisplay segfault X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0f3fecf0c6a17b2327054928d7ae660bb65a5e49;p=flightgear.git Fix NavDisplay segfault When "addSymbolInstance" returns NULL, we cannot update "ins->endPos". --- diff --git a/src/Instrumentation/NavDisplay.cxx b/src/Instrumentation/NavDisplay.cxx index 862d00f26..ecf9bdfc5 100644 --- a/src/Instrumentation/NavDisplay.cxx +++ b/src/Instrumentation/NavDisplay.cxx @@ -1172,7 +1172,7 @@ void NavDisplay::foundPositionedItem(FGPositioned* pos) BOOST_FOREACH(SymbolRule* r, rules) { SymbolInstance* ins = addSymbolInstance(projected, heading, r->getDefinition(), vars); - if (pos->type() == FGPositioned::RUNWAY) { + if ((ins)&&(pos->type() == FGPositioned::RUNWAY)) { FGRunway* rwy = (FGRunway*) pos; ins->endPos = projectGeod(rwy->end()); }