From 5ab7628df726352f18d12886349eb70d45c20ac9 Mon Sep 17 00:00:00 2001 From: Ofek Weiss Date: Sun, 4 Aug 2024 11:03:44 +0300 Subject: [PATCH] handle list of None owners --- elementary/utils/json_utils.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/elementary/utils/json_utils.py b/elementary/utils/json_utils.py index 500f9192b..835b1a045 100644 --- a/elementary/utils/json_utils.py +++ b/elementary/utils/json_utils.py @@ -51,7 +51,13 @@ def unpack_and_flatten_and_dedup_list_of_strings( if isinstance(list_maybe_jsoned, str): ret = unpack_and_flatten_str_to_list(list_maybe_jsoned) elif isinstance(list_maybe_jsoned, list): - ret = sum_lists([unpack_and_flatten_str_to_list(x) for x in list_maybe_jsoned]) + ret = sum_lists( + [ + unpack_and_flatten_str_to_list(x) + for x in list_maybe_jsoned + if isinstance(x, str) + ] + ) return list(set(ret))