From 644337e615021141b7a081ee23be81708fe8ff58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Thu, 5 Jul 2018 18:06:58 +0200 Subject: [PATCH] fix: Improve error message in case the object template is unknown. --- pymisp/mispevent.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pymisp/mispevent.py b/pymisp/mispevent.py index 5a9ed51..1b665c8 100644 --- a/pymisp/mispevent.py +++ b/pymisp/mispevent.py @@ -846,6 +846,8 @@ class MISPObjectAttribute(MISPAttribute): if self.to_ids is None: # Same for the to_ids flag self.to_ids = self._definition.get('to_ids') + if not self.type: + raise NewAttributeError("The type of the attribute is required. Is the object template missing?") super(MISPObjectAttribute, self).from_dict(**dict(self, **kwargs)) def __repr__(self):