diff --git a/src/Sound/fg_fx.cxx b/src/Sound/fg_fx.cxx index c5fa6ae5e..66c06d5d8 100644 --- a/src/Sound/fg_fx.cxx +++ b/src/Sound/fg_fx.cxx @@ -75,6 +75,8 @@ FGFX::FGFX ( const std::string &refname, SGPropertyNode *props ) : _avionics = _smgr->find("avionics", true); _avionics->tie_to_listener(); } + else + _avionics = NULL; } void FGFX::unbind() @@ -174,7 +176,7 @@ FGFX::update (double dt) if ( _enabled->getBoolValue() ) { - if ( _avionics_enabled->getBoolValue()) + if ( _avionics && _avionics_enabled->getBoolValue()) { if (_avionics_ext->getBoolValue() || _internal->getBoolValue()) { // avionics sound is enabled