summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--alot/commands/search.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/alot/commands/search.py b/alot/commands/search.py
index 4901b34f..072764c2 100644
--- a/alot/commands/search.py
+++ b/alot/commands/search.py
@@ -149,6 +149,10 @@ class TagCommand(Command):
def apply(self, ui):
threadline_widget = ui.current_buffer.get_selected_threadline()
+ # pass if the current buffer has no selected threadline
+ # (displays an empty search result)
+ if threadline_widget is None:
+ return
thread = threadline_widget.get_thread()
testquery = "(%s) AND thread:%s" % (ui.current_buffer.querystring,
thread.get_thread_id())