diff options
author | Yoann L <yoann.lamouroux@data-impact.fr> | 2019-11-14 18:59:43 +0100 |
---|---|---|
committer | Yoann L <yoann.lamouroux@data-impact.fr> | 2019-11-14 18:59:43 +0100 |
commit | 9a1ec6b0646e67a8d9332910efec35752d003561 (patch) | |
tree | be7574383372b7f3e76054a588aefa082532e930 | |
parent | dac0bfe786a8d1dfdd97f29d6bb262ed258153fa (diff) | |
download | mitmproxy-9a1ec6b0646e67a8d9332910efec35752d003561.tar.gz mitmproxy-9a1ec6b0646e67a8d9332910efec35752d003561.tar.bz2 mitmproxy-9a1ec6b0646e67a8d9332910efec35752d003561.zip |
Fixes #3694
-rw-r--r-- | mitmproxy/addons/view.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/mitmproxy/addons/view.py b/mitmproxy/addons/view.py index 4224877a..da9d19f9 100644 --- a/mitmproxy/addons/view.py +++ b/mitmproxy/addons/view.py @@ -238,18 +238,24 @@ class View(collections.abc.Sequence): """ Set focus to the next flow. """ - idx = self.focus.index + 1 - if self.inbounds(idx): - self.focus.flow = self[idx] + if self.focus.index is not None: + idx = self.focus.index + 1 + if self.inbounds(idx): + self.focus.flow = self[idx] + else: + pass @command.command("view.focus.prev") def focus_prev(self) -> None: """ Set focus to the previous flow. """ - idx = self.focus.index - 1 - if self.inbounds(idx): - self.focus.flow = self[idx] + if self.focus.index is not None: + idx = self.focus.index - 1 + if self.inbounds(idx): + self.focus.flow = self[idx] + else: + pass # Order @command.command("view.order.options") |