]> git.mxchange.org Git - flightgear.git/commitdiff
Fix a potential crash when an electrical system is not defined.
authorcurt <curt>
Wed, 18 Dec 2002 21:55:33 +0000 (21:55 +0000)
committercurt <curt>
Wed, 18 Dec 2002 21:55:33 +0000 (21:55 +0000)
src/Systems/electrical.cxx

index f4eebbbac2125d9064a4c5db9bdf0b30ef1ea8c6..9fc8109577f7f4f9ddac95281fe491814655b2b4 100644 (file)
@@ -211,8 +211,10 @@ FGElectricalSystem::~FGElectricalSystem () {
 void FGElectricalSystem::init () {
     config_props = new SGPropertyNode;
 
+    SGPropertyNode *path_n = fgGetNode("/sim/systems/electrical/path", true);
+
     SGPath config( globals->get_fg_root() );
-    config.append( fgGetString("/sim/systems/electrical/path") );
+    config.append( path_n->getStringValue() );
 
     SG_LOG( SG_ALL, SG_ALERT, "Reading electrical system model from "
             << config.str() );