1
0
Fork 0

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:
Torsten Dreyer 2010-12-27 14:24:44 +01:00
parent a0d1a5cb10
commit e1858b14b6

View file

@ -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 );