From a21c989ccdcb8f96a1b98fd216d9cb3ee1173681 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sun, 28 Jul 2013 22:40:51 +1200 Subject: [PATCH] Fix startup with no state. Bug introduced in previous patch. --- libmproxy/console/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libmproxy/console/__init__.py b/libmproxy/console/__init__.py index cf4fc9884..69fa6fa86 100644 --- a/libmproxy/console/__init__.py +++ b/libmproxy/console/__init__.py @@ -204,7 +204,10 @@ class StatusBar(common.WWrap): self.message("") fc = self.master.state.flow_count() - offset = min(self.master.state.focus + 1, fc) + if self.master.state.focus is None: + offset = 0 + else: + offset = min(self.master.state.focus + 1, fc) t = [ ('heading', ("[%s/%s]"%(offset, fc)).ljust(9)) ]