IDE: fix exception when re-opening previously closed tab wxPython4
authorEdouard Tisserant <edouard.tisserant@gmail.com>
Sun, 12 Mar 2023 00:55:19 +0100
branchwxPython4
changeset 3747 1db10e9df882
parent 3746 41be039fbb8c
child 3748 a811e1ff718a
IDE: fix exception when re-opening previously closed tab

Same as commit with same message, this time for tabs that are not POUs editors.
ProjectController.py
--- a/ProjectController.py	Sun Mar 12 00:51:53 2023 +0100
+++ b/ProjectController.py	Sun Mar 12 00:55:19 2023 +0100
@@ -1329,7 +1329,7 @@
 
     def _OpenView(self, name=None, onlyopened=False):
         if name == "IEC code":
-            if self._IECCodeView is None:
+            if not self._IECCodeView:
                 plc_file = self._getIECcodepath()
 
                 self._IECCodeView = IECCodeViewer(
@@ -1351,7 +1351,7 @@
             return self._IECCodeView
 
         elif name == "IEC raw code":
-            if self._IECRawCodeView is None:
+            if not self._IECRawCodeView:
                 controler = MiniTextControler(self._getIECrawcodepath(), self)
 
                 self._IECRawCodeView = IECCodeViewer(
@@ -1368,7 +1368,7 @@
             return self._IECRawCodeView
 
         elif name == "Project Files":
-            if self._ProjectFilesView is None:
+            if not self._ProjectFilesView:
                 self._ProjectFilesView = FileManagementPanel(
                     self.AppFrame.TabsOpened, self, name, self._getProjectFilesPath(), True)