From 0d6329e3e734c420cc3f7c35232afad47efd4648 Mon Sep 17 00:00:00 2001 From: Torsten Dreyer Date: Tue, 24 Aug 2010 20:32:41 +0200 Subject: [PATCH] Don't segfault on missing boundary table --- src/Environment/environment_ctrl.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Environment/environment_ctrl.cxx b/src/Environment/environment_ctrl.cxx index 74f1d82ea..0cc434e69 100644 --- a/src/Environment/environment_ctrl.cxx +++ b/src/Environment/environment_ctrl.cxx @@ -135,7 +135,9 @@ FGInterpolateEnvironmentCtrl::init () read_table( boundary_n, _boundary_table); // pass in a pointer to the environment of the last bondary layer as // a starting point - read_table( aloft_n, _aloft_table, &(*(_boundary_table.end()-1))->environment); + read_table( aloft_n, _aloft_table, + _boundary_table.size() > 0 ? + &(*(_boundary_table.end()-1))->environment : NULL ); } void -- 2.39.5