Skip to content

Commit

Permalink
fix #1682
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@10753 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed May 7, 2009
1 parent acd619f commit 0d1ab92
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/core/raster/qgsrasterlayer.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 0d1ab92

Please sign in to comment.