diff --git a/pymisp/mispevent.py b/pymisp/mispevent.py index bfaeadd8..5feb2255 100644 --- a/pymisp/mispevent.py +++ b/pymisp/mispevent.py @@ -1121,6 +1121,11 @@ def add_attributes(self, object_relation: str, *attributes: Sequence[str | dict[ It is the same as calling multiple times add_attribute with the same object_relation. ''' to_return = [] + + if not attributes: + logger.warning(f"No attributes provided for object relation '{object_relation}'; skipping attribute addition.") + return to_return + for attribute in attributes: if isinstance(attribute, MISPAttribute): a = self.add_attribute(object_relation, **attribute.to_dict())