From 743ad7f494f202a40bcee5136e38ab8627a685ba Mon Sep 17 00:00:00 2001 From: Christian Herdtweck Date: Fri, 1 Oct 2021 08:55:26 +0200 Subject: [PATCH] ftguess: Avoid error for unknown OpenXML types --- oletools/ftguess.py | 7 +++++++ 1 file changed, 7 insertions(+), 0 deletions(-) diff --git a/oletools/ftguess.py b/oletools/ftguess.py index 5c865b5..e2a369a 100644 --- a/oletools/ftguess.py +++ b/oletools/ftguess.py @@ -424,6 +424,13 @@ class FType_Generic_OpenXML(FType_Base): # else: # # TODO: log error, raise anomaly (or maybe it's the case for XPS?) # return False + if main_part is None: + # just warn but do not raise an exception. This might be just + # another strange data type out there that we do not understand + # yet. Return False so file type will stay FType_Generic_OpenXML + log.warning('Failed to find any known relationship in OpenXML-file') + return False + # parse content types, find content type of main part try: content_types = ftg.zipfile.read('[Content_Types].xml') -- libgit2 0.21.4