Bug on Delete one element from an empty DebugVariablePanel fixed
authorlaurent
Thu, 10 Dec 2009 09:33:34 +0100
changeset 481 593068548dca
parent 480 5389728644a5
child 482 4edbbab206a3
Bug on Delete one element from an empty DebugVariablePanel fixed
PLCOpenEditor.py
--- a/PLCOpenEditor.py	Wed Dec 09 16:50:19 2009 +0100
+++ b/PLCOpenEditor.py	Thu Dec 10 09:33:34 2009 +0100
@@ -4183,10 +4183,11 @@
     
     def OnDeleteButton(self, event):
         idx = self.VariablesGrid.GetGridCursorRow()
-        item = self.Table.GetItem(idx)
-        self.RemoveDataConsumer(item)
-        self.Table.RemoveItem(idx)
-        self.RefreshGrid()
+        if idx >= 0:
+            item = self.Table.GetItem(idx)
+            self.RemoveDataConsumer(item)
+            self.Table.RemoveItem(idx)
+            self.RefreshGrid()
         event.Skip()
 
     def OnUpButton(self, event):