From c2da881010e1d286f5ceb8b0c311ccf8e891246b Mon Sep 17 00:00:00 2001 From: James Turner Date: Sat, 25 Mar 2017 14:28:30 +0000 Subject: [PATCH] Fix a crash in NavList (Tests are good) --- src/Navaids/navlist.cxx | 2 +- src/Navaids/navlist.hxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Navaids/navlist.cxx b/src/Navaids/navlist.cxx index 9b0c911de..50c07a2e9 100644 --- a/src/Navaids/navlist.cxx +++ b/src/Navaids/navlist.cxx @@ -203,7 +203,7 @@ FGNavRecordRef FGNavList::findByFreq( double freq, BOOST_FOREACH(PositionedID id, stations) { FGNavRecordRef station = FGPositioned::loadById(id); - if (!filter->pass(station)) { + if (filter && !filter->pass(station)) { continue; } diff --git a/src/Navaids/navlist.hxx b/src/Navaids/navlist.hxx index c10b7e3b7..0cdfeb74a 100644 --- a/src/Navaids/navlist.hxx +++ b/src/Navaids/navlist.hxx @@ -93,7 +93,7 @@ public: * so a position must be specified. */ static FGNavRecordRef findByFreq( double freq, const SGGeod& position, - TypeFilter* filter = NULL); + TypeFilter* filter = nullptr); /** * Overloaded version above - no positioned supplied so can be used with