From b0ea4cd391eb5dee790ff3c1c17109bac5fa424e Mon Sep 17 00:00:00 2001 From: Michael van der Kamp Date: Sun, 2 Jun 2024 19:09:26 -0700 Subject: [PATCH] Catch IndexError on empty Variables state --- pudb/debugger.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pudb/debugger.py b/pudb/debugger.py index dc06d9ef..063f0c32 100644 --- a/pudb/debugger.py +++ b/pudb/debugger.py @@ -994,9 +994,12 @@ def collapse_current(var, pos, iinfo): return None def change_var_state(w, size, key): - pos = self.var_list._w.focus_position - var = self.var_list._w.focus + try: + pos = self.var_list._w.focus_position + except IndexError: + return + var = self.var_list._w.focus if var is None: return