Skip to content
Permalink
Browse files

Don't crash with no attribute set in graduated renderer

  • Loading branch information
NathanW2 committed Sep 28, 2014
1 parent a8ce356 commit 428375ed4c1d2fa55ae6794e99287a07df25c2cc
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp
@@ -954,8 +954,10 @@ QList<double> QgsGraduatedSymbolRendererV2::getDataValues( QgsVectorLayer *vlaye

void QgsGraduatedSymbolRendererV2::updateClasses( QgsVectorLayer *vlayer, Mode mode, int nclasses )
{
// Custom classes are not recalculated
if ( mAttrName.isEmpty() ) return;

setMode( mode );
// Custom classes are not recalculated
if ( mode == Custom ) return;

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


int attrNum = vlayer->fieldNameIndex( mAttrName );

if ( attrNum == -1 )

0 comments on commit 428375e

Please sign in to comment.
You can’t perform that action at this time.