git-svn-id: http://svn.osgeo.org/qgis/trunk@10753 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
jef 2009-05-07 16:26:07 +00:00
parent af1e2208e1
commit 4b4c9547e2

View File

@ -712,7 +712,14 @@ const QgsRasterBandStats QgsRasterLayer::bandStatistics( int theBandNo )
QgsRasterBandStats myNullReturnStats;
return myNullReturnStats;
}
// check if we have previously gathered stats for this band...
if ( theBandNo < 1 || theBandNo > mRasterStatsList.size() )
{
// invalid band id, return nothing
QgsRasterBandStats myNullReturnStats;
return myNullReturnStats;
}
QgsRasterBandStats myRasterBandStats = mRasterStatsList[theBandNo - 1];
myRasterBandStats.bandNumber = theBandNo;