From 1c34660af451c109125dca4db977225f9a851766 Mon Sep 17 00:00:00 2001 From: Christian Herdtweck Date: Thu, 28 Apr 2016 15:00:52 +0200 Subject: [PATCH] fixed bug: only close vba_parser if it is not None --- oletools/olevba.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/oletools/olevba.py b/oletools/olevba.py index 746b4ed..257e071 100755 --- a/oletools/olevba.py +++ b/oletools/olevba.py @@ -2999,7 +2999,8 @@ def main(): return_code = RETURN_PARSE_ERROR if return_code == 0 \ else RETURN_SEVERAL_ERRS finally: - vba_parser.close() + if vba_parser is not None: + vba_parser.close() if options.output_mode == 'triage': print '\n(Flags: OpX=OpenXML, XML=Word2003XML, MHT=MHTML, TXT=Text, M=Macros, ' \ -- libgit2 0.21.4