From 57793fb6d6c7865f06b0575972ee7a69a35933d7 Mon Sep 17 00:00:00 2001
From: Florian Bruhin <git@the-compiler.org>
Date: Sun, 5 Feb 2017 18:53:58 +0100
Subject: [PATCH] Handle hint keypress without a context.

Fixes #2098
---
 qutebrowser/browser/hints.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/qutebrowser/browser/hints.py b/qutebrowser/browser/hints.py
index cb638d4c9..391fc1c58 100644
--- a/qutebrowser/browser/hints.py
+++ b/qutebrowser/browser/hints.py
@@ -753,6 +753,9 @@ class HintManager(QObject):
 
     def handle_partial_key(self, keystr):
         """Handle a new partial keypress."""
+        if self._context is None:
+            log.hints.debug("Got key without context!")
+            return
         log.hints.debug("Handling new keystring: '{}'".format(keystr))
         for string, label in self._context.labels.items():
             try: