Fix weird crash in on_tab_changed

This commit is contained in:
Florian Bruhin 2014-07-06 21:33:50 +02:00
parent 934b009fd0
commit 6d44cf1b6e

View File

@ -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()