fix: [stix import] Additional test if leveraged ttps are not None to avoid issues

pull/5162/head
chrisr3d 2019-09-10 16:15:34 +02:00
parent 1e57e73fb3
commit 25d5ed6447
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
1 changed files with 1 additions and 1 deletions

View File

@ -1152,7 +1152,7 @@ class StixFromMISPParser(StixParser):
galaxies_references.extend([coa.course_of_action.idref for coa in coas])
if self.event.attributed_threat_actors:
galaxies_references.extend([ta.item.idref for ta in self.event.attributed_threat_actors.threat_actor])
if self.event.leveraged_ttps.ttp:
if self.event.leveraged_ttps and self.event.leveraged_ttps.ttp:
galaxies_references.extend([ttp.item.idref for ttp in self.event.leveraged_ttps.ttp])
self.galaxies_references = tuple('-'.join((r for r in ref.split('-')[-5:])) for ref in galaxies_references)