mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
check if value is None before trying to cast float
the tool used to fail when there were NULL values in the fields
This commit is contained in:
parent
6130505c79
commit
75b3464e1c
@ -104,16 +104,17 @@ class BasicStatisticsNumbers(GeoAlgorithm):
|
||||
total = 100.0 / float(count)
|
||||
current = 0
|
||||
for ft in features:
|
||||
value = float(ft.attributes()[index])
|
||||
if isFirst:
|
||||
minValue = value
|
||||
maxValue = value
|
||||
isFirst = False
|
||||
else:
|
||||
if value < minValue:
|
||||
if ft.attributes()[index]:
|
||||
value = float(ft.attributes()[index])
|
||||
if isFirst:
|
||||
minValue = value
|
||||
if value > maxValue:
|
||||
maxValue = value
|
||||
isFirst = False
|
||||
else:
|
||||
if value < minValue:
|
||||
minValue = value
|
||||
if value > maxValue:
|
||||
maxValue = value
|
||||
|
||||
values.append(value)
|
||||
sumValue += value
|
||||
|
Loading…
x
Reference in New Issue
Block a user