mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2025-02-02 00:05:27 +00:00
Merge pull request #3698 from ylmrx/crash_on_empty_focus_next
Fixes crash upon view.focus.[next|prev] - #3694
This commit is contained in:
commit
d38e20689e
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user