Skip to content

Commit

Permalink
[backend] Fix createdBy validation on SDO edit (#6291)
Browse files Browse the repository at this point in the history
  • Loading branch information
SouadHadjiat committed Mar 13, 2024
1 parent 1a0ae19 commit 9113b2e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ export const stixDomainObjectEditField = async (context, user, stixObjectId, inp
}

const createdByKey = input.find((inputData) => inputData.key === 'createdBy');
if (createdByKey) {
await validateCreatedBy(context, user, input.value[0]);
if (createdByKey && createdByKey.value?.length > 0) {
await validateCreatedBy(context, user, createdByKey.value[0]);
}

const { element: updatedElem } = await updateAttribute(context, user, stixObjectId, ABSTRACT_STIX_DOMAIN_OBJECT, input, opts);
Expand Down

0 comments on commit 9113b2e

Please sign in to comment.