controls/DebugVariablePanel/DebugVariableGraphicViewer.py
branchpython3
changeset 3764 d92c1a3dafa7
parent 3752 9f6f46dbe3ae
child 3765 88fe6fc9fd38
--- a/controls/DebugVariablePanel/DebugVariableGraphicViewer.py	Fri Oct 28 18:54:33 2022 +0800
+++ b/controls/DebugVariablePanel/DebugVariableGraphicViewer.py	Fri Oct 28 18:59:04 2022 +0800
@@ -489,11 +489,12 @@
         @param item: Item from which data to export, all items if None
         (default None)
         """
-        self.ParentWindow.CopyDataToClipboard(
-            [(item, [entry for entry in item.GetData()])
-             for item in (self.Items
-                          if item is None
-                          else [item])])
+        if item and item.GetData():
+            self.ParentWindow.CopyDataToClipboard(
+                [(item, [entry for entry in item.GetData()])
+                 for item in (self.Items
+                              if item is None
+                              else [item])])
 
     def OnZoomFitButton(self):
         """
@@ -590,7 +591,7 @@
 
             # Search for point that tick is the nearest from mouse X position
             # and set cursor tick to the tick of this point
-            if len(data) > 0:
+            if data and len(data) > 0:
                 cursor_tick = data[numpy.argmin(
                     numpy.abs(data[:, 0] - event.xdata)), 0]