We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d901e50 commit c59cd92Copy full SHA for c59cd92
src/providers/gdal/qgsgdalproviderbase.cpp
@@ -63,11 +63,14 @@ QList<QgsColorRampShader::ColorRampItem> QgsGdalProviderBase::colorTable( GDALDa
63
// load category labels
64
char ** categoryNames = GDALGetRasterCategoryNames( myGdalBand );
65
QVector<QString> labels;
66
- int i = 0;
67
- while ( categoryNames[i] )
+ if ( categoryNames )
68
{
69
- labels.append( QString( categoryNames[i] ) );
70
- i++;
+ int i = 0;
+ while ( categoryNames[i] )
+ {
71
+ labels.append( QString( categoryNames[i] ) );
72
+ i++;
73
+ }
74
}
75
76
int myEntryCount = GDALGetColorEntryCount( myGdalColorTable );
0 commit comments