Avoid throwing exceptions when unneeded to avoid problems
parent
4c6519cf43
commit
855bc96863
|
@ -139,14 +139,12 @@ class MarkingDefinition(_STIXBase, _MarkingsMixin):
|
|||
except KeyError:
|
||||
raise ValueError("definition_type must be a valid marking type")
|
||||
|
||||
try:
|
||||
if 'created' in kwargs:
|
||||
if _should_set_millisecond(kwargs['created'], marking_type):
|
||||
self._properties = copy.deepcopy(self._properties)
|
||||
self._properties.update([
|
||||
('created', TimestampProperty(default=lambda: NOW, precision='millisecond')),
|
||||
])
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
if not isinstance(kwargs['definition'], marking_type):
|
||||
defn = _get_dict(kwargs['definition'])
|
||||
|
|
Loading…
Reference in New Issue