Skip to content

Commit

Permalink
Fixed attributeError when loading a QGIS project (#1063)
Browse files Browse the repository at this point in the history
  • Loading branch information
benvanbasten-ns committed Nov 15, 2024
1 parent d45a2f9 commit 6f51232
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
3.12 (unreleased)
-----------------

- Nothing changed yet.
- Fixed attributeError when loading a QGIS project (#1063)


3.11 (2024-11-12)
Expand Down
17 changes: 9 additions & 8 deletions threedi_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,17 +262,18 @@ def read(self, doc: QDomDocument) -> bool:
self.model.clear()
return False

# Allow each tool to read additional info from the dedicated xml node
for tool, _ in self.tools:
if not tool.read(tool_node):
if tool_node:
# Allow each tool to read additional info from the dedicated xml node
for tool, _ in self.tools:
if not tool.read(tool_node):
self.model.clear()
return False

# Also allow animator to read saved settings
if not self.map_animator.read(tool_node):
self.model.clear()
return False

# Also allow animator to read saved settings
if not self.map_animator.read(tool_node):
self.model.clear()
return False

return True

def unload(self):
Expand Down

0 comments on commit 6f51232

Please sign in to comment.