From ecfe4eb21be2fde44e8bccdbd5b247bf07cb304e Mon Sep 17 00:00:00 2001 From: jmt Date: Mon, 2 Nov 2009 23:33:07 +0000 Subject: [PATCH] Check one potential source of the prime-meridian crash. --- src/Navaids/positioned.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Navaids/positioned.cxx b/src/Navaids/positioned.cxx index 2651199ce..c4bce783c 100644 --- a/src/Navaids/positioned.cxx +++ b/src/Navaids/positioned.cxx @@ -35,6 +35,7 @@ #include #include #include +#include #include "positioned.hxx" @@ -240,6 +241,10 @@ public: bool operator()(const FGPositionedRef& a, const FGPositionedRef& b) const { + if (!a || !b) { + throw sg_exception("empty reference passed to DistanceOrdering"); + } + double dA = distSqr(a->cart(), mPos), dB = distSqr(b->cart(), mPos); return dA < dB;