Browse Source

wxGUI: fix closing d.* dialog of a new layer which was removed (merge from trunk, https://trac.osgeo.org/grass/changeset/62824)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@62825 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 10 years ago
parent
commit
9ba4c6deee
1 changed files with 5 additions and 1 deletions
  1. 5 1
      gui/wxpython/gui_core/forms.py

+ 5 - 1
gui/wxpython/gui_core/forms.py

@@ -765,7 +765,11 @@ class TaskFrame(wx.Frame):
                 self.Hide()
             # canceled layer with nothing set
             elif len(self.parent.GetLayerInfo(self.layer, key = 'cmd')) < 1:
-                self.parent.Delete(self.layer)
+                try:
+                    self.parent.Delete(self.layer)
+                except ValueError:
+                    # happens when closing dialog of a new layer which was removed from tree
+                    pass
                 self.Destroy()
         else:
             # cancel for non-display commands