Skip to content

Commit 58a7edb

Browse files
committed
Use isNull() to test for null attribute values
1 parent 029c403 commit 58a7edb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ QgsSymbolV2* QgsGraduatedSymbolRendererV2::symbolForFeature( QgsFeature& feature
193193
}
194194

195195
// Null values should not be categorized
196-
if ( attrs[mAttrNum].toString().isEmpty() )
196+
if ( attrs[mAttrNum].isNull() )
197197
return NULL;
198198

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

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

815815
// calculate the breaks

0 commit comments

Comments
 (0)