From 59c507261980741a155d8831f2c35de54dc36524 Mon Sep 17 00:00:00 2001 From: mpeltriaux Date: Fri, 27 May 2022 15:01:43 +0200 Subject: [PATCH] #138 Bugfix * fixes bug where empty geometry would have lead to exception during is_valid check on SimpleGeomForm --- konova/forms.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/konova/forms.py b/konova/forms.py index a4e04fc9..72a44681 100644 --- a/konova/forms.py +++ b/konova/forms.py @@ -311,6 +311,9 @@ class SimpleGeomForm(BaseForm): # Get geojson from form geom = self.data["geom"] + if geom is None or len(geom) == 0: + # empty geometry is a valid geometry + return is_valid geom = json.loads(geom) # Write submitted data back into form field to make sure invalid geometry