From eb5a5ad64ba1a0b7567ad8c9b108135420f789c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20Paszko?= Date: Mon, 9 Oct 2023 16:18:39 +0200 Subject: [PATCH] Fixed firestore _utils.py Fix for situations when numeric value equals to zero. If will not match in this cases and comparsion to None is needed. --- firebase/firestore/_utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/firebase/firestore/_utils.py b/firebase/firestore/_utils.py index b43f949..d0e3d7d 100644 --- a/firebase/firestore/_utils.py +++ b/firebase/firestore/_utils.py @@ -76,13 +76,13 @@ def _decode_datastore(value): elif value.get('booleanValue') is not None: return bool(value['booleanValue']) - elif value.get('bytesValue'): + elif value.get('bytesValue') is not None: return b64decode(value['bytesValue'].encode('utf-8')) - elif value.get('integerValue'): + elif value.get('integerValue') is not None: return int(value['integerValue']) - elif value.get('doubleValue'): + elif value.get('doubleValue') is not None: return float(value['doubleValue']) elif isinstance(value.get('stringValue'), str):