瀏覽代碼

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

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@68199 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 9 年之前
父節點
當前提交
f2ee8c2284
共有 1 個文件被更改,包括 4 次插入1 次删除
  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()