diff --git a/src/validation/objectGeneralInformation.ts b/src/validation/objectGeneralInformation.ts index e30492d0..33bb79fc 100644 --- a/src/validation/objectGeneralInformation.ts +++ b/src/validation/objectGeneralInformation.ts @@ -18,7 +18,7 @@ export const SCHEMA_GENERAL_INFORMATION = object({ }, ctx ) => { - if (Owner_1_UUID === Owner_2_UUID) { + if (!!Owner_1_UUID && !!Owner_2_UUID && Owner_1_UUID === Owner_2_UUID) { ctx.addIssue({ code: 'custom', message: @@ -34,7 +34,11 @@ export const SCHEMA_GENERAL_INFORMATION = object({ }) } - if (Portfolio_Holder_1_UUID === Portfolio_Holder_2_UUID) { + if ( + !!Portfolio_Holder_1_UUID && + !!Portfolio_Holder_2_UUID && + Portfolio_Holder_1_UUID === Portfolio_Holder_2_UUID + ) { ctx.addIssue({ code: 'custom', message: