From c59b6bf02b6967324df5d479a3cd8cc9d1e93934 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 27 Feb 2017 09:05:40 +0100 Subject: [PATCH] Handle invalid layout in TabBarStyle.subElementRect --- qutebrowser/mainwindow/tabwidget.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qutebrowser/mainwindow/tabwidget.py b/qutebrowser/mainwindow/tabwidget.py index dd9a54d5b..8d7e179b4 100644 --- a/qutebrowser/mainwindow/tabwidget.py +++ b/qutebrowser/mainwindow/tabwidget.py @@ -681,6 +681,9 @@ class TabBarStyle(QCommonStyle): """ if sr == QStyle.SE_TabBarTabText: layouts = self._tab_layout(opt) + if layouts is None: + log.misc.warning("Could not get layouts for tab!") + return QRect() return layouts.text elif sr == QStyle.SE_TabWidgetTabBar: # Need to use super() because we also use super() to render