Skip to content

Commit

Permalink
fix: add None check for cusotm filters
Browse files Browse the repository at this point in the history
  • Loading branch information
RaczeQ committed Nov 3, 2024
1 parent 401d43b commit d1556f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions quackosm/pbf_file_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit d1556f9

Please sign in to comment.