Selaa lähdekoodia

wxGUI/modeler: fix GetData()

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@48148 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 13 vuotta sitten
vanhempi
commit
3d607dcf2c
2 muutettua tiedostoa jossa 6 lisäystä ja 1 poistoa
  1. 3 1
      gui/wxpython/gui_modules/gmodeler.py
  2. 3 0
      gui/wxpython/gui_modules/menuform.py

+ 3 - 1
gui/wxpython/gui_modules/gmodeler.py

@@ -211,12 +211,14 @@ class Model(object):
         """!Get list of data items"""
         result = list()
         dataItems = self.GetItems(objType = ModelData)
+        
         for action in self.GetItems(objType = ModelAction):
             for rel in action.GetRelations():
                 dataItem = rel.GetData()
                 if dataItem not in result:
                     result.append(dataItem)
-                dataItems.remove(dataItem)
+                if dataItem in dataItems:
+                    dataItems.remove(dataItem)
         
         # standalone data
         if dataItems:

+ 3 - 0
gui/wxpython/gui_modules/menuform.py

@@ -219,6 +219,9 @@ class UpdateThread(Thread):
         # update reference widgets
         for uid in p['wxId-bind']:
             win = self.parent.FindWindowById(uid)
+            if not win:
+                continue
+            
             name = win.GetName()
             
             map = layer = None