summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2018-10-03 15:15:25 +0200
committerFlorian Bruhin <me@the-compiler.org>2018-10-03 15:15:25 +0200
commit9ca6da485c93ced9616bfc8d96df54e7d939b221 (patch)
tree587ea055814b7d00a26533a075a055b929e1b887
parent1cedfc5470966faab4a5e3b57485cd43e779eac2 (diff)
downloadqutebrowser-9ca6da485c93ced9616bfc8d96df54e7d939b221.tar.gz
qutebrowser-9ca6da485c93ced9616bfc8d96df54e7d939b221.zip
Handle None values in lessThan
-rw-r--r--doc/changelog.asciidoc1
-rw-r--r--qutebrowser/completion/models/listcategory.py9
2 files changed, 9 insertions, 1 deletions
diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc
index aa067469a..c6d8116ba 100644
--- a/doc/changelog.asciidoc
+++ b/doc/changelog.asciidoc
@@ -100,6 +100,7 @@ Fixed
- Crash when trying to load an empty session file.
- `:hint` with an invalid `--mode=` value now shows a proper error.
- Rare crash on Qt 5.11.2 when clicking on `<select>` elements.
+- Rare crash related to the completion.
Removed
~~~~~~~
diff --git a/qutebrowser/completion/models/listcategory.py b/qutebrowser/completion/models/listcategory.py
index 13bc1e6b2..ac0d0cdd0 100644
--- a/qutebrowser/completion/models/listcategory.py
+++ b/qutebrowser/completion/models/listcategory.py
@@ -24,7 +24,7 @@ import re
from PyQt5.QtCore import Qt, QSortFilterProxyModel, QRegExp
from PyQt5.QtGui import QStandardItem, QStandardItemModel
-from qutebrowser.utils import qtutils
+from qutebrowser.utils import qtutils, log
class ListCategory(QSortFilterProxyModel):
@@ -80,6 +80,13 @@ class ListCategory(QSortFilterProxyModel):
left = self.srcmodel.data(lindex)
right = self.srcmodel.data(rindex)
+ if left is None or right is None:
+ log.completion.warning("Got unexpected None value, "
+ "left={!r} right={!r} "
+ "lindex={!r} rindex={!r}"
+ .format(left, right, lindex, rindex))
+ return False
+
leftstart = left.startswith(self._pattern)
rightstart = right.startswith(self._pattern)