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)