Skip to content

Commit

Permalink
Merge pull request #291 from Samweli/fix_none_priority_layers
Browse files Browse the repository at this point in the history
Fix priority layers access in the priority layer dialog
  • Loading branch information
Samweli authored Nov 15, 2023
2 parents 7c97341 + f3a2f76 commit 64cd4da
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/cplus_plugin/gui/priority_layer_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 64cd4da

Please sign in to comment.