GlobalWeather: don't crash
Don't crash when flying into METAR generated weather reporting fog/mist/haze and clear sky
This commit is contained in:
parent
a0d1a5cb10
commit
e1858b14b6
1 changed files with 1 additions and 1 deletions
|
@ -280,7 +280,7 @@ void MetarProperties::set_metar( const char * metar )
|
|||
if( coverage != SGMetarCloud::COVERAGE_NIL ) {
|
||||
|
||||
// if there is a layer above the fog, limit the top to one foot below that layer's bottom
|
||||
if( metarClouds[0].getCoverage() != SGMetarCloud::COVERAGE_CLEAR )
|
||||
if( metarClouds.size() > 0 && metarClouds[0].getCoverage() != SGMetarCloud::COVERAGE_CLEAR )
|
||||
thickness = metarClouds[0].getAltitude_ft() - LAYER_BOTTOM_STATION_OFFSET - 1;
|
||||
|
||||
SGPropertyNode_ptr layerNode = cloudsNode->getChild(LAYER, 0, true );
|
||||
|
|
Loading…
Reference in a new issue