From 20d63d3a94b542f6f77431e309396ad2cc027b3a Mon Sep 17 00:00:00 2001 From: Sergey Motornyuk Date: Tue, 31 Jan 2023 12:07:11 +0200 Subject: [PATCH] TypeError when spatial is missing --- ckanext/spatial/search/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ckanext/spatial/search/__init__.py b/ckanext/spatial/search/__init__.py index a54141d..4b45d94 100644 --- a/ckanext/spatial/search/__init__.py +++ b/ckanext/spatial/search/__init__.py @@ -19,6 +19,9 @@ class SpatialSearchBackend: """Base class for all datastore backends.""" def parse_geojson(self, geom_from_metadata): + if not geom_from_metadata: + log.error("Metadata does not contain geometry, not indexing") + return None try: geometry = json.loads(geom_from_metadata)