]> git.mxchange.org Git - flightgear.git/commitdiff
Don't segfault on missing boundary table
authorTorsten Dreyer <Torsten@t3r.de>
Tue, 24 Aug 2010 18:32:41 +0000 (20:32 +0200)
committerTorsten Dreyer <Torsten@t3r.de>
Tue, 24 Aug 2010 18:32:41 +0000 (20:32 +0200)
src/Environment/environment_ctrl.cxx

index 74f1d82ea9275f15de2e80d4a2be999ed826e47f..0cc434e69392cfe537cf2d616acdff0b50460105 100644 (file)
@@ -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