Fix AbstractTab repr() with no URL available

This commit is contained in:
Florian Bruhin 2016-07-07 18:24:08 +02:00
parent d9516b9c1d
commit ee7b4256a9

View File

@ -527,6 +527,9 @@ class AbstractTab(QWidget):
raise NotImplementedError
def __repr__(self):
url = utils.elide(self.cur_url.toDisplayString(QUrl.EncodeUnicode),
100)
try:
url = utils.elide(self.cur_url.toDisplayString(QUrl.EncodeUnicode),
100)
except AttributeError:
url = '<AttributeError>'
return utils.get_repr(self, tab_id=self.tab_id, url=url)