1
0
Fork 0

Fix a potential crash when an electrical system is not defined.

This commit is contained in:
curt 2002-12-18 21:55:33 +00:00
parent 77d6412817
commit 2d09acb10f

View file

@ -211,8 +211,10 @@ FGElectricalSystem::~FGElectricalSystem () {
void FGElectricalSystem::init () { void FGElectricalSystem::init () {
config_props = new SGPropertyNode; config_props = new SGPropertyNode;
SGPropertyNode *path_n = fgGetNode("/sim/systems/electrical/path", true);
SGPath config( globals->get_fg_root() ); 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 " SG_LOG( SG_ALL, SG_ALERT, "Reading electrical system model from "
<< config.str() ); << config.str() );