--- 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]