From 21d3d8d48a017a9e1b569021873faa68db56048e Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Mon, 24 Jun 2019 11:35:26 +0200 Subject: [PATCH] Set default value for reach point levels to NULL Fix https://github.com/QGEP/QGEP/issues/498 --- src/tools/qgepmaptooladdfeature.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tools/qgepmaptooladdfeature.py b/src/tools/qgepmaptooladdfeature.py index 9fa2d7b4..2ca5604b 100644 --- a/src/tools/qgepmaptooladdfeature.py +++ b/src/tools/qgepmaptooladdfeature.py @@ -334,9 +334,12 @@ def right_clicked(self, _): # assign level if the match is a node or if we have 3D from snapping if match.layer() == self.node_layer: level = network_element['bottom_level'] + level = level if not math.isnan(level) else NULL f.setAttribute(level_field_index, level) elif self.rubberband.points[pt_idx].z() != 0: - f.setAttribute(level_field_index, self.rubberband.points[pt_idx].z()) + level = self.rubberband.points[pt_idx].z() + level = level if not math.isnan(level) else NULL + f.setAttribute(level_field_index, level) dlg = self.iface.getFeatureForm(self.layer, f) dlg.setMode(QgsAttributeEditorContext.AddFeatureMode)