From 2d09acb10f37d74cb723d0004730a585daf48b2c Mon Sep 17 00:00:00 2001 From: curt Date: Wed, 18 Dec 2002 21:55:33 +0000 Subject: [PATCH] Fix a potential crash when an electrical system is not defined. --- src/Systems/electrical.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Systems/electrical.cxx b/src/Systems/electrical.cxx index f4eebbbac..9fc810957 100644 --- a/src/Systems/electrical.cxx +++ b/src/Systems/electrical.cxx @@ -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() );