From b20c47772b6533a88b35e7d98bcad47cb3954556 Mon Sep 17 00:00:00 2001 From: Denis Rouzaud Date: Thu, 20 May 2021 18:16:13 +0200 Subject: [PATCH] fix crash --- ordered_relation_editor/core/ordered_relation_model.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ordered_relation_editor/core/ordered_relation_model.py b/ordered_relation_editor/core/ordered_relation_model.py index 6e5bfb3..9f6d754 100644 --- a/ordered_relation_editor/core/ordered_relation_model.py +++ b/ordered_relation_editor/core/ordered_relation_model.py @@ -142,7 +142,8 @@ def moveitems(self, index_from, index_to): @pyqtSlot(int) def onViewCurrentFeatureChanged(self, index): - self.currentFeatureChanged.emit(self._related_features[index]) + if index >= 0 and index < len(self._related_features): + self.currentFeatureChanged.emit(self._related_features[index]) def roleNames(self): return {