fix: Avoid adding file object twice if a KeyError exception comes for some unexpected reasons

chrisr3d 2019-07-25 17:47:08 +02:00
parent ddeb04bd74
commit 3d41104d5b
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
1 changed files with 4 additions and 3 deletions

View File

@ -217,10 +217,11 @@ class JoeParser():
for field, mapping in file_object_mapping.items():
attribute_type, object_relation = mapping
file_object.add_attribute(object_relation, **{'type': attribute_type, 'value': fileinfo[field]})
to_call = arch_type_mapping[['generalinfo']['arch']]
arch =['generalinfo']['arch']
if arch in arch_type_mapping:
to_call = arch_type_mapping[arch]
getattr(self, to_call)(fileinfo, file_object)
except KeyError:
def parse_apk(self, fileinfo, file_object):