Skip to content

Commit

Permalink
Use isEmpty() to test for null values
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Mar 4, 2013
1 parent f7bf3f2 commit 029c403
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ QgsSymbolV2* QgsGraduatedSymbolRendererV2::symbolForFeature( QgsFeature& feature
}

// Null values should not be categorized
if ( attrs[mAttrNum] == "")
if ( attrs[mAttrNum].toString().isEmpty() )
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 ) != "" )
if ( !f.attribute( attrNum ).toString().isEmpty() )
values.append( f.attribute( attrNum ).toDouble() );

// calculate the breaks
Expand Down

0 comments on commit 029c403

Please sign in to comment.