[GRASS-SVN] r68199 - grass/branches/releasebranch_7_0/gui/wxpython/gmodeler

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Apr 1 05:29:20 PDT 2016


Author: martinl
Date: 2016-04-01 05:29:20 -0700 (Fri, 01 Apr 2016)
New Revision: 68199

Modified:
   grass/branches/releasebranch_7_0/gui/wxpython/gmodeler/model.py
Log:
wxGUI/gmodeler: errors when changing order of commands (indexation of items seems wrong) (merge r68198 from trunk) #2836

Modified: grass/branches/releasebranch_7_0/gui/wxpython/gmodeler/model.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/gmodeler/model.py	2016-04-01 12:23:29 UTC (rev 68198)
+++ grass/branches/releasebranch_7_0/gui/wxpython/gmodeler/model.py	2016-04-01 12:29:20 UTC (rev 68199)
@@ -120,7 +120,10 @@
             item = self.items.pop(oldIdx)
             items.append(item)
             self.items.insert(newIdx, item)
-            nextItem = self.items[newIdx+1]
+            try:
+                nextItem = self.items[newIdx+1]
+            except IndexError:
+                continue # newIdx is the last item in the list
             items.append(nextItem)
             x = item.GetX()
             y = item.GetY()



More information about the grass-commit mailing list