Fix a potential crash when an electrical system is not defined.
This commit is contained in:
parent
77d6412817
commit
2d09acb10f
1 changed files with 3 additions and 1 deletions
|
@ -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() );
|
||||||
|
|
Loading…
Reference in a new issue