Skip to content

Commit

Permalink
Fix calculation with null strings
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Sep 7, 2017
1 parent 3086619 commit 30c663e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions python/plugins/processing/algs/qgis/StatisticsByCategories.py
Expand Up @@ -158,10 +158,13 @@ def addField(name):
continue
else:
value = float(attrs[value_field_index])
elif field_type == 'string':
if attrs[value_field_index] == NULL:
value=''
else:
value = str(attrs[value_field_index])
elif attrs[value_field_index] == NULL:
value = NULL
elif field_type == 'string':
value = str(attrs[value_field_index])
else:
value = attrs[value_field_index]
cat = tuple([attrs[c] for c in category_field_indexes])
Expand Down

0 comments on commit 30c663e

Please sign in to comment.