Fixed bug when open editor while Build is working
authorLaurent Bessard
Wed, 03 Jul 2013 11:08:09 +0200
changeset 1272 0086cbee609b
parent 1271 757b83fd2173
child 1273 921858d68a13
Fixed bug when open editor while Build is working
Beremiz.py
--- a/Beremiz.py	Wed Jun 26 17:53:45 2013 +0200
+++ b/Beremiz.py	Wed Jul 03 11:08:09 2013 +0200
@@ -1048,14 +1048,15 @@
             IDEFrame.OnProjectTreeItemActivated(self, event)
     
     def ProjectTreeItemSelect(self, select_item):
-        name = self.ProjectTree.GetItemText(select_item)
-        item_infos = self.ProjectTree.GetPyData(select_item)
-        if item_infos["type"] == ITEM_CONFNODE:
-            item_infos["confnode"]._OpenView(onlyopened=True)
-        elif item_infos["type"] == ITEM_PROJECT:
-            self.CTR._OpenView(onlyopened=True)
-        else:
-            IDEFrame.ProjectTreeItemSelect(self, select_item)
+        if select_item is not None and select_item.IsOk():
+            name = self.ProjectTree.GetItemText(select_item)
+            item_infos = self.ProjectTree.GetPyData(select_item)
+            if item_infos["type"] == ITEM_CONFNODE:
+                item_infos["confnode"]._OpenView(onlyopened=True)
+            elif item_infos["type"] == ITEM_PROJECT:
+                self.CTR._OpenView(onlyopened=True)
+            else:
+                IDEFrame.ProjectTreeItemSelect(self, select_item)
     
     def SelectProjectTreeItem(self, tagname):
         if self.ProjectTree is not None: