Fix bug when closing project
authorLaurent Bessard
Tue, 29 Jan 2013 18:01:51 +0100
changeset 915 8dc28b21bdac
parent 914 94436558f0ce
child 916 697d8b77d716
Fix bug when closing project
controls/PouInstanceVariablesPanel.py
--- a/controls/PouInstanceVariablesPanel.py	Tue Jan 29 21:34:43 2013 +1100
+++ b/controls/PouInstanceVariablesPanel.py	Tue Jan 29 18:01:51 2013 +0100
@@ -105,13 +105,14 @@
         self.RefreshView()
     
     def SetPouType(self, tagname, pou_instance=None):
-        self.PouTagName = tagname
-        if self.PouTagName == "Project":
-            config_name = self.Controller.GetProjectMainConfigurationName()
-            if config_name is not None:
-                self.PouTagName = self.Controller.ComputeConfigurationName(config_name)
-        if pou_instance is not None:
-            self.PouInstance = pou_instance
+        if  self.Controller is not None:
+            self.PouTagName = tagname
+            if self.PouTagName == "Project":
+                config_name = self.Controller.GetProjectMainConfigurationName()
+                if config_name is not None:
+                    self.PouTagName = self.Controller.ComputeConfigurationName(config_name)
+            if pou_instance is not None:
+                self.PouInstance = pou_instance
         
         self.RefreshView()