From 59277a805435565857d068010b87aa6932ba6d5c Mon Sep 17 00:00:00 2001 From: tommiesster Date: Fri, 9 Dec 2022 00:12:58 -0500 Subject: [PATCH] verify array is not None in collection for array_contains condition --- mockfirestore/query.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mockfirestore/query.py b/mockfirestore/query.py index 7a4618d..62fe5fe 100644 --- a/mockfirestore/query.py +++ b/mockfirestore/query.py @@ -134,6 +134,6 @@ def _compare_func(self, op: str) -> Callable[[T, T], bool]: elif op == 'in': return lambda x, y: x in y elif op == 'array_contains': - return lambda x, y: y in x + return lambda x, y: x is not None and y in x elif op == 'array_contains_any': return lambda x, y: any([val in y for val in x])