Explorar o código

wxGUI/gmodeler: errors when changing order of commands (indexation of items seems wrong) https://trac.osgeo.org/grass/ticket/2836

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@68198 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa %!s(int64=9) %!d(string=hai) anos
pai
achega
d2c8eaa59e
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      gui/wxpython/gmodeler/model.py

+ 4 - 1
gui/wxpython/gmodeler/model.py

@@ -120,7 +120,10 @@ class Model(object):
             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()