From 70a0f875708a4eb91b75d9a9aa49ea26bc134186 Mon Sep 17 00:00:00 2001 From: Nikhil Soni Date: Tue, 28 Mar 2017 20:05:02 +0530 Subject: Override set_focus to check for index error --- mitmproxy/tools/console/flowlist.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mitmproxy/tools/console/flowlist.py b/mitmproxy/tools/console/flowlist.py index 31d48ee3..044f8f05 100644 --- a/mitmproxy/tools/console/flowlist.py +++ b/mitmproxy/tools/console/flowlist.py @@ -57,6 +57,10 @@ class LogBufferBox(urwid.ListBox): self.master = master urwid.ListBox.__init__(self, master.logbuffer) + def set_focus(self, index): + if 0 <= index < len(self.master.logbuffer): + super().set_focus(index) + def keypress(self, size, key): key = common.shortcuts(key) if key == "z": -- cgit v1.2.3