diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-02-08 23:42:56 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-02-08 23:42:56 +1300 |
commit | 46c5982d3da0355f458ceea2077230fbed9c289b (patch) | |
tree | 583f1f45c663da8cac99e57cdfe5f507e837e07b /libmproxy | |
parent | 205d2ad577f0d00ed7d3ff36b8ba24bcdf312585 (diff) | |
download | mitmproxy-46c5982d3da0355f458ceea2077230fbed9c289b.tar.gz mitmproxy-46c5982d3da0355f458ceea2077230fbed9c289b.tar.bz2 mitmproxy-46c5982d3da0355f458ceea2077230fbed9c289b.zip |
Fix a crash and some sizing issues in KVEditor.
Mostly arising when editing an empty header set.
Diffstat (limited to 'libmproxy')
-rw-r--r-- | libmproxy/console/kveditor.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libmproxy/console/kveditor.py b/libmproxy/console/kveditor.py index 632a6992..e74895bb 100644 --- a/libmproxy/console/kveditor.py +++ b/libmproxy/console/kveditor.py @@ -90,7 +90,9 @@ class KVItem(common.WWrap): class KVWalker(urwid.ListWalker): def __init__(self, lst): self.lst = lst - self.maxk = max(len(v[0]) for v in lst) + self.maxk = max(len(v[0]) for v in lst) if lst else 20 + if self.maxk < 20: + self.maxk = 20 self.focus = 0 self.focus_col = 0 self.editing = False |