mirror of https://github.com/MISP/PyMISP
fix: Do not fail if the attribute value is not a string
parent
74a5d04bda
commit
1e9eed198e
|
@ -850,6 +850,7 @@ class MISPObject(AbstractMISP):
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
# Make sure we're not adding an empty value.
|
# Make sure we're not adding an empty value.
|
||||||
|
if isinstance(value['value'], str):
|
||||||
value['value'] = value['value'].strip()
|
value['value'] = value['value'].strip()
|
||||||
if value['value'] == '':
|
if value['value'] == '':
|
||||||
logger.warning("The value of the attribute you're trying to add is an empty string, skipping it. Object relation: {}".format(object_relation))
|
logger.warning("The value of the attribute you're trying to add is an empty string, skipping it. Object relation: {}".format(object_relation))
|
||||||
|
|
Loading…
Reference in New Issue