Skip to content
Permalink
Browse files
Use isNull() to test for null attribute values
  • Loading branch information
nyalldawson committed Mar 4, 2013
1 parent 029c403 commit 58a7edbb76559fda15d6d98d2c36abeed8a39d94
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp
@@ -193,7 +193,7 @@ QgsSymbolV2* QgsGraduatedSymbolRendererV2::symbolForFeature( QgsFeature& feature
}

// Null values should not be categorized
if ( attrs[mAttrNum].toString().isEmpty() )
if ( attrs[mAttrNum].isNull() )
return NULL;

// find the right category
@@ -809,7 +809,7 @@ QgsGraduatedSymbolRendererV2* QgsGraduatedSymbolRendererV2::createRenderer(

// create list of non-null attribute values
while ( fit.nextFeature( f ) )
if ( !f.attribute( attrNum ).toString().isEmpty() )
if ( !f.attribute( attrNum ).isNull() )
values.append( f.attribute( attrNum ).toDouble() );

// calculate the breaks

0 comments on commit 58a7edb

Please sign in to comment.