Skip to content

Commit

Permalink
Fix crash when count_value_null is None
Browse files Browse the repository at this point in the history
  • Loading branch information
kostko committed Jul 22, 2017
1 parent cce29e1 commit a4ca3d5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion datastream/backends/influxdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,9 @@ def count(self):
if isinstance(results, dict):
result_keys = results.keys()
if 'count_value' in result_keys:
return results.get('count_value', 0) + results.get('count_value_null', 0)
count_value = results.get('count_value', 0) or 0
count_value_null = results.get('count_value_null', 0) or 0
return count_value + count_value_null
else:
return max([results[key] for key in results.keys() if key.startswith('count')])
elif isinstance(results, tuple):
Expand Down

0 comments on commit a4ca3d5

Please sign in to comment.