From d1556f96be31b8087393046c0a3f22d157163d36 Mon Sep 17 00:00:00 2001 From: Kamil Raczycki Date: Sun, 3 Nov 2024 09:49:42 +0100 Subject: [PATCH] fix: add None check for cusotm filters --- quackosm/pbf_file_reader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quackosm/pbf_file_reader.py b/quackosm/pbf_file_reader.py index 689259a..3f43b10 100644 --- a/quackosm/pbf_file_reader.py +++ b/quackosm/pbf_file_reader.py @@ -1112,7 +1112,7 @@ def _generate_result_file_path( if self.tags_filter is not None: keep_all_tags_part = "" if not keep_all_tags else "_alltags" h = hashlib.new("sha256") - h.update((json.dumps(self.tags_filter) + str(self.custom_sql_filter)).encode()) + h.update((json.dumps(self.tags_filter) + str(self.custom_sql_filter or "")).encode()) osm_filter_tags_hash_part = f"{h.hexdigest()}{keep_all_tags_part}" clipping_geometry_hash_part = self._generate_geometry_hash() @@ -1144,7 +1144,7 @@ def _generate_result_file_path_from_geometry( if self.tags_filter is not None: keep_all_tags_part = "" if not keep_all_tags else "_alltags" h = hashlib.new("sha256") - h.update((json.dumps(self.tags_filter) + str(self.custom_sql_filter)).encode()) + h.update((json.dumps(self.tags_filter) + str(self.custom_sql_filter or "")).encode()) osm_filter_tags_hash_part = f"{h.hexdigest()}{keep_all_tags_part}" clipping_geometry_hash_part = self._generate_geometry_hash()