Skip to content

Commit

Permalink
chg: Validate attributes in attributes.setter
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafiot committed Dec 21, 2017
1 parent 749acd7 commit b745fce
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pymisp/mispevent.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,10 @@ def attributes(self):

@attributes.setter
def attributes(self, attributes):
self.Attribute = attributes
if all(isinstance(x, MISPAttribute) for x in attributes):
self.Attribute = attributes
else:
raise PyMISPError('All the attributes have to be of type MISPAttribute.')

@property
def related_events(self):
Expand Down

0 comments on commit b745fce

Please sign in to comment.