From c3db6aa680cf2ef0dc85729e9a75f425db61932c Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Tue, 30 Sep 2014 17:19:07 +0000 Subject: [PATCH] Explicitly return None for negative event indices. Prior to this, eventat(-1) would return the next-to-last event causing the back button to cycle back to the end of an event source instead of stopping at the start. --- tools/sched/schedgraph.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/sched/schedgraph.py b/tools/sched/schedgraph.py index 4335574972e5..e5925141e69c 100644 --- a/tools/sched/schedgraph.py +++ b/tools/sched/schedgraph.py @@ -856,7 +856,7 @@ def ysize(self): return (Y_EVENTSOURCE) def eventat(self, i): - if (i >= len(self.events)): + if (i >= len(self.events) or i < 0): return (None) event = self.events[i] return (event)