Skip to content

Commit c59cd92

Browse files
committedNov 4, 2013
Load raster category names fix
1 parent d901e50 commit c59cd92

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed
 

‎src/providers/gdal/qgsgdalproviderbase.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,14 @@ QList<QgsColorRampShader::ColorRampItem> QgsGdalProviderBase::colorTable( GDALDa
6363
// load category labels
6464
char ** categoryNames = GDALGetRasterCategoryNames( myGdalBand );
6565
QVector<QString> labels;
66-
int i = 0;
67-
while ( categoryNames[i] )
66+
if ( categoryNames )
6867
{
69-
labels.append( QString( categoryNames[i] ) );
70-
i++;
68+
int i = 0;
69+
while ( categoryNames[i] )
70+
{
71+
labels.append( QString( categoryNames[i] ) );
72+
i++;
73+
}
7174
}
7275

7376
int myEntryCount = GDALGetColorEntryCount( myGdalColorTable );

0 commit comments

Comments
 (0)
Please sign in to comment.