fix: [stix 1/2 import] Avoid adding the original stix file in the event if the option is not checked

pull/5259/head
chrisr3d 2019-09-28 01:47:23 +02:00
parent 6239738192
commit de9184d4de
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
1 changed files with 3 additions and 1 deletions

View File

@ -5852,7 +5852,9 @@ class Event extends AppModel
$validationIssues = false;
$result = $this->_add($data, true, $user, '', null, false, null, $created_id, $validationIssues);
if ($result) {
$this->add_original_file($tempFile, $original_file, $created_id, $stix_version);
if ($original_file) {
$this->add_original_file($tempFile, $original_file, $created_id, $stix_version);
}
return $created_id;
}
return $validationIssues;