Commit 1c34660af451c109125dca4db977225f9a851766

Authored by Christian Herdtweck
1 parent d773e543

fixed bug: only close vba_parser if it is not None

Showing 1 changed file with 2 additions and 1 deletions
oletools/olevba.py
@@ -2999,7 +2999,8 @@ def main(): @@ -2999,7 +2999,8 @@ def main():
2999 return_code = RETURN_PARSE_ERROR if return_code == 0 \ 2999 return_code = RETURN_PARSE_ERROR if return_code == 0 \
3000 else RETURN_SEVERAL_ERRS 3000 else RETURN_SEVERAL_ERRS
3001 finally: 3001 finally:
3002 - vba_parser.close() 3002 + if vba_parser is not None:
  3003 + vba_parser.close()
3003 3004
3004 if options.output_mode == 'triage': 3005 if options.output_mode == 'triage':
3005 print '\n(Flags: OpX=OpenXML, XML=Word2003XML, MHT=MHTML, TXT=Text, M=Macros, ' \ 3006 print '\n(Flags: OpX=OpenXML, XML=Word2003XML, MHT=MHTML, TXT=Text, M=Macros, ' \