Skip to content

Commit

Permalink
Remove deleted layers from internal list
Browse files Browse the repository at this point in the history
There is no use in keeping layers that have been removed from the
project in the internal list.

Fixes #488
Fixes #502
Fixes #468
  • Loading branch information
m-kuhn committed Apr 20, 2023
1 parent a1a3d4b commit 207aed1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions qfieldsync/gui/layers_config_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,11 @@ def _on_message_bus_messaged(self, msg: str) -> None:
if msg != "layer_config_saved":
return

for layer_source in self.layer_sources:
layer_source.read_layer()
for layer_source in self.layer_sources.copy():
try:
layer_source.read_layer()
except RuntimeError:
self.layer_sources.remove(layer_source)

# quite ugly workaround, but this method sometimes operates on deleted objects,
# so we need to make sure we don't get exceptions
Expand Down

0 comments on commit 207aed1

Please sign in to comment.