controls/DebugVariablePanel/DebugVariableItem.py
changeset 2742 5f7445b582d4
parent 2741 3cc5663af196
child 3292 ef04cedee08b
--- a/controls/DebugVariablePanel/DebugVariableItem.py	Mon Jun 14 16:48:39 2021 +0200
+++ b/controls/DebugVariablePanel/DebugVariableItem.py	Wed Jun 16 12:15:02 2021 +0200
@@ -384,7 +384,7 @@
         ticks = self.Data.view[:, 0]
 
         # Get nearest data from tick
-        idx = np.searchsorted(ticks, tick)
+        idx = min(np.searchsorted(ticks, tick), self.Data.count - 1)
 
         # Adjust data index according to constraint
         if adjust < 0 and ticks[idx] > tick and idx > 0 or \