mirror of https://github.com/MISP/PyMISP
fix: Improve error message in case the object template is unknown.
parent
2a772466ae
commit
644337e615
|
@ -846,6 +846,8 @@ class MISPObjectAttribute(MISPAttribute):
|
||||||
if self.to_ids is None:
|
if self.to_ids is None:
|
||||||
# Same for the to_ids flag
|
# Same for the to_ids flag
|
||||||
self.to_ids = self._definition.get('to_ids')
|
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))
|
super(MISPObjectAttribute, self).from_dict(**dict(self, **kwargs))
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
|
|
Loading…
Reference in New Issue