Skip to content

Commit

Permalink
Don't crash with no attribute set in graduated renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanW2 committed Sep 28, 2014
1 parent a8ce356 commit 428375e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -965,6 +967,7 @@ void QgsGraduatedSymbolRendererV2::updateClasses( QgsVectorLayer *vlayer, Mode m
double minimum;
double maximum;


int attrNum = vlayer->fieldNameIndex( mAttrName );

if ( attrNum == -1 )
Expand Down

0 comments on commit 428375e

Please sign in to comment.