1
0
Fork 0

Fix a potential segfault.

This commit is contained in:
curt 2003-09-24 19:57:50 +00:00
parent f348ffa800
commit c841343796

View file

@ -168,7 +168,7 @@ void FGProps2NetCtrls( FGNetCtrls *net, bool honor_freezes,
tempnode = fgGetNode("/controls/gear", true); tempnode = fgGetNode("/controls/gear", true);
for ( i = 0; i < FGNetCtrls::FG_MAX_WHEELS; ++i ) { for ( i = 0; i < FGNetCtrls::FG_MAX_WHEELS; ++i ) {
node = fgGetNode("/controls/gear/wheel", i); node = fgGetNode("/controls/gear/wheel", i);
if ( node->getChild("brake") != NULL ) { if ( node != NULL && node->getChild("brake") != NULL ) {
if ( tempnode->getChild("parking-brake")->getDoubleValue() > 0.0 ) { if ( tempnode->getChild("parking-brake")->getDoubleValue() > 0.0 ) {
net->brake[i] = 1.0; net->brake[i] = 1.0;
} else { } else {