Make sure we return if there is nothing to add to the collection

stix2.0
Emmanuelle Vargas-Gonzalez 2018-03-19 11:00:09 -04:00
parent c98abb18f5
commit 32cb62cca2
1 changed files with 2 additions and 0 deletions

View File

@ -83,6 +83,8 @@ class TAXIICollectionSink(DataSink):
# adding list of something - recurse on each # adding list of something - recurse on each
for obj in stix_data: for obj in stix_data:
self.add(obj, version=version) self.add(obj, version=version)
else:
return # If the list is empty just return.
elif isinstance(stix_data, str): elif isinstance(stix_data, str):
# adding json encoded string of STIX content # adding json encoded string of STIX content