Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Fix calculation with null strings
- Loading branch information
Showing
with
5 additions
and
2 deletions.
-
+5
−2
python/plugins/processing/algs/qgis/StatisticsByCategories.py
|
@@ -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]) |
|
|