Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit 6a3fd7c

Browse files
committed
[client] Handle empty string in vocab
1 parent ff5fb2c commit 6a3fd7c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pycti/utils/opencti_stix2.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,10 @@ def extract_embedded_relationships(
334334
for field in self.mapping_cache_permanent["vocabularies_definition_fields"]
335335
):
336336
for f in self.mapping_cache_permanent["vocabularies_definition_fields"]:
337-
if stix_object.get(f["key"]) is None:
337+
if (
338+
stix_object.get(f["key"]) is None
339+
or len(stix_object.get(f["key"])) == 0
340+
):
338341
continue
339342
if isinstance(stix_object.get(f["key"]), list):
340343
object_open_vocabularies[f["key"]] = []

0 commit comments

Comments
 (0)