Browse Source

wxGUI/modeler: check validity of input file when loading
(merge https://trac.osgeo.org/grass/changeset/67464 from trunk)


git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@67465 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 9 years ago
parent
commit
c7e030334c
1 changed files with 7 additions and 0 deletions
  1. 7 0
      gui/wxpython/gmodeler/model.py

+ 7 - 0
gui/wxpython/gmodeler/model.py

@@ -1741,6 +1741,13 @@ class ProcessModelFile:
         """
         self.tree = tree
         self.root = self.tree.getroot()
+        # check if input is a valid GXM file
+        if self.root is None or self.root.tag != 'gxm':
+            if self.root is not None:
+                tagName = self.root.tag
+            else:
+                tabName = _("empty")
+            raise GException(_("Details: unsupported tag name '{}'.").format(tagName))
         
         # list of actions, data
         self.properties = dict()