Skip to content

Commit

Permalink
Use isNull() to test for null attribute values
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Mar 4, 2013
1 parent 029c403 commit 58a7edb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 58a7edb

Please sign in to comment.