Skip to content

Commit 428375e

Browse files
committedSep 28, 2014
Don't crash with no attribute set in graduated renderer
1 parent a8ce356 commit 428375e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,8 +954,10 @@ QList<double> QgsGraduatedSymbolRendererV2::getDataValues( QgsVectorLayer *vlaye
954954

955955
void QgsGraduatedSymbolRendererV2::updateClasses( QgsVectorLayer *vlayer, Mode mode, int nclasses )
956956
{
957-
// Custom classes are not recalculated
957+
if ( mAttrName.isEmpty() ) return;
958+
958959
setMode( mode );
960+
// Custom classes are not recalculated
959961
if ( mode == Custom ) return;
960962

961963
if ( nclasses < 1 ) nclasses = 1;
@@ -965,6 +967,7 @@ void QgsGraduatedSymbolRendererV2::updateClasses( QgsVectorLayer *vlayer, Mode m
965967
double minimum;
966968
double maximum;
967969

970+
968971
int attrNum = vlayer->fieldNameIndex( mAttrName );
969972

970973
if ( attrNum == -1 )

0 commit comments

Comments
 (0)
Please sign in to comment.