From 6d44cf1b6eea1647e95c9eb111337caa3da4fc64 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 6 Jul 2014 21:33:50 +0200 Subject: [PATCH] Fix weird crash in on_tab_changed --- qutebrowser/widgets/statusbar/progress.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qutebrowser/widgets/statusbar/progress.py b/qutebrowser/widgets/statusbar/progress.py index 7a8e8abac..90d7b0867 100644 --- a/qutebrowser/widgets/statusbar/progress.py +++ b/qutebrowser/widgets/statusbar/progress.py @@ -67,6 +67,10 @@ class Progress(QProgressBar): @pyqtSlot(int) def on_tab_changed(self, tab): """Set the correct value when the current tab changed.""" + if self is None: + # This should never happen, but for some weird reason it does + # sometimes. + return self.setValue(tab.progress) if tab.load_status == LoadStatus.loading: self.show()