From 5f0acdf5e0e4972de0c7ece07d2dbb3c51b62f8a Mon Sep 17 00:00:00 2001 From: signedav Date: Wed, 29 Nov 2023 13:23:31 +0100 Subject: [PATCH] check if the layer is a vectorlayer before getting the fields. This fixes #849 --- modelbaker/utils/qgis_utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modelbaker/utils/qgis_utils.py b/modelbaker/utils/qgis_utils.py index 6a60990..9e473a3 100644 --- a/modelbaker/utils/qgis_utils.py +++ b/modelbaker/utils/qgis_utils.py @@ -159,6 +159,8 @@ def get_oid_settings(self): tree_layers = root.findLayers() for tree_layer in tree_layers: # get t_ili_tid field OID field + if tree_layer.layer().type() != QgsMapLayer.VectorLayer: + continue fields = tree_layer.layer().fields() field_idx = fields.lookupField("t_ili_tid") if field_idx < 0: