From f3a2f76445e58383e9bf46fccf5576506ace245e Mon Sep 17 00:00:00 2001 From: Samweli Date: Wed, 15 Nov 2023 12:43:25 +0300 Subject: [PATCH] None priority layers usage --- src/cplus_plugin/gui/priority_layer_dialog.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cplus_plugin/gui/priority_layer_dialog.py b/src/cplus_plugin/gui/priority_layer_dialog.py index d02d5a841..88177abca 100644 --- a/src/cplus_plugin/gui/priority_layer_dialog.py +++ b/src/cplus_plugin/gui/priority_layer_dialog.py @@ -165,11 +165,16 @@ def set_selected_models(self, models, removed_models=[]): for layer in model.priority_layers if layer is not None ] - if str(self.layer.get("uuid")) not in models_layer_uuids: + if ( + self.layer is not None + and str(self.layer.get("uuid")) not in models_layer_uuids + ): model.priority_layers.append(self.layer) settings_manager.save_implementation_model(model) for model in removed_models: for layer in model.priority_layers: + if layer is None: + continue if str(layer.get("uuid")) == str(self.layer.get("uuid")): model.priority_layers.remove(layer) settings_manager.save_implementation_model(model)