From 0da65f14d0ba8c2ca2aa8f615d03d97783143e8b Mon Sep 17 00:00:00 2001 From: Keegi Date: Tue, 13 Sep 2011 14:41:05 +0300 Subject: [PATCH] Fix exception on removing the last custombutton when there are no other custombuttons --- pronterface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pronterface.py b/pronterface.py index ea4973d..6193729 100755 --- a/pronterface.py +++ b/pronterface.py @@ -727,7 +727,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole): n = button.custombutton self.custombuttons[n]=None self.cbutton_save(n,None) - while self.custombuttons[-1] is None: + while len(self.custombuttons) and self.custombuttons[-1] is None: del self.custombuttons[-1] self.cbuttons_reload()