From 940c996d968d4c26fc146a7f9e2221bbbbd553de Mon Sep 17 00:00:00 2001 From: Ryan Welton Date: Tue, 11 Mar 2014 15:32:10 -0400 Subject: [PATCH] Don't crash when no results are returned --- search.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/search.py b/search.py index abfa8e9..7a76b47 100755 --- a/search.py +++ b/search.py @@ -36,7 +36,8 @@ sys.exit(1) print_header_line() -doc = message.doc[0] -for c in doc.child: +if len(message.doc) > 0: + doc = message.doc[0] + for c in doc.child: print_result_line(c)