mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
fix #1682
git-svn-id: http://svn.osgeo.org/qgis/trunk@10753 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
af1e2208e1
commit
4b4c9547e2
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user