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

Commit a6ad73b

Browse files
author
Samuel Hassine
committed
[client] Fix export empty field
1 parent 6ef66c6 commit a6ad73b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pycti/utils/opencti_stix2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ def generate_export(self, entity: Dict) -> Dict:
10101010
external_reference["external_id"] = entity_external_reference[
10111011
"external_id"
10121012
]
1013-
if "importFiles" in entity_external_reference:
1013+
if "importFiles" in entity_external_reference and len(entity_external_reference["importFiles"]) > 0:
10141014
external_reference["x_opencti_files"] = []
10151015
for file in entity_external_reference["importFiles"]:
10161016
url = (
@@ -1208,7 +1208,7 @@ def prepare_export(
12081208
if file:
12091209
entity["payload_bin"] = file
12101210
# Files
1211-
if "importFiles" in entity:
1211+
if "importFiles" in entity and len(entity["importFiles"]) > 0:
12121212
entity["x_opencti_files"] = []
12131213
for file in entity["importFiles"]:
12141214
url = (

0 commit comments

Comments
 (0)