]> git.mxchange.org Git - flightgear.git/blobdiff - src/Environment/metarproperties.cxx
Merge branch 'next' of git://gitorious.org/fg/flightgear into next
[flightgear.git] / src / Environment / metarproperties.cxx
index 2f6cac2be2525b01809f289190645f89ce11a9d9..9582c9ee66210a0b1d336fdbb6a1b7046e0e1588 100644 (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 );