Skip to content

Commit

Permalink
Merge pull request #67 from castaples/remove-keyerror
Browse files Browse the repository at this point in the history
Remove KeyError bug
  • Loading branch information
chrisr3d authored Sep 17, 2024
2 parents 687e10a + b848606 commit 1b3909b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions misp_stix_converter/stix2misp/external_stix2_to_misp.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,9 @@ def _handle_unparsed_content(self):
return super()._handle_unparsed_content()
unparsed_content = defaultdict(list)
for object_id, content in self._observable.items():
if content['used'][self.misp_event.uuid]:
continue
if self.misp_event.uuid in content['used']:
if content['used'][self.misp_event.uuid]:
continue
unparsed_content[content['observable'].type].append(object_id)
for observable_type in self._mapping.observable_object_types():
if observable_type not in unparsed_content:
Expand All @@ -180,8 +181,9 @@ def _handle_unparsed_content(self):
continue
to_call = f'_parse_{feature}_observable_object'
for object_id in unparsed_content[observable_type]:
if self._observable[object_id]['used'][self.misp_event.uuid]:
continue
if self.misp_event.uuid in self._observable[object_id]['used']:
if self._observable[object_id]['used'][self.misp_event.uuid]:
continue
try:
getattr(self.observable_object_parser, to_call)(object_id)
except Exception as exception:
Expand Down

0 comments on commit 1b3909b

Please sign in to comment.