Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[backend] Fix Promote observable component crashes (#6399) #6402

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@
type = 'StixFile';
}
const pattern = await createStixPattern(context, AUTOMATION_MANAGER_USER, key, value);
const { score } = observable.extensions[STIX_EXT_OCTI_SCO];
const score = observable.extensions[STIX_EXT_OCTI_SCO]?.score;

Check warning on line 856 in opencti-platform/opencti-graphql/src/modules/playbook/playbook-components.ts

View check run for this annotation

Codecov / codecov/patch

opencti-platform/opencti-graphql/src/modules/playbook/playbook-components.ts#L856

Added line #L856 was not covered by tests
const { granted_refs } = observable.extensions[STIX_EXT_OCTI];
if (pattern) {
const indicatorData = {
Expand Down Expand Up @@ -881,13 +881,13 @@
if (observable.object_marking_refs) {
indicator.object_marking_refs = observable.object_marking_refs;
}
if (observable.extensions[STIX_EXT_OCTI_SCO].labels) {
if (observable.extensions[STIX_EXT_OCTI_SCO]?.labels) {

Check warning on line 884 in opencti-platform/opencti-graphql/src/modules/playbook/playbook-components.ts

View check run for this annotation

Codecov / codecov/patch

opencti-platform/opencti-graphql/src/modules/playbook/playbook-components.ts#L884

Added line #L884 was not covered by tests
indicator.labels = observable.extensions[STIX_EXT_OCTI_SCO].labels;
}
if (observable.extensions[STIX_EXT_OCTI_SCO].created_by_ref) {
if (observable.extensions[STIX_EXT_OCTI_SCO]?.created_by_ref) {

Check warning on line 887 in opencti-platform/opencti-graphql/src/modules/playbook/playbook-components.ts

View check run for this annotation

Codecov / codecov/patch

opencti-platform/opencti-graphql/src/modules/playbook/playbook-components.ts#L887

Added line #L887 was not covered by tests
indicator.created_by_ref = observable.extensions[STIX_EXT_OCTI_SCO].created_by_ref;
}
if (observable.extensions[STIX_EXT_OCTI_SCO].external_references) {
if (observable.extensions[STIX_EXT_OCTI_SCO]?.external_references) {

Check warning on line 890 in opencti-platform/opencti-graphql/src/modules/playbook/playbook-components.ts

View check run for this annotation

Codecov / codecov/patch

opencti-platform/opencti-graphql/src/modules/playbook/playbook-components.ts#L890

Added line #L890 was not covered by tests
indicator.external_references = observable.extensions[STIX_EXT_OCTI_SCO].external_references;
}
if (granted_refs) {
Expand Down
Loading