Skip to content

Commit

Permalink
fix: prevent error when destructuring field instance id
Browse files Browse the repository at this point in the history
  • Loading branch information
vsgoulart committed Oct 24, 2024
1 parent 2869e1c commit 3ce4054
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/form-js-viewer/src/core/Validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class Validator {
* @returns {Array<string>}
*/
validateFieldInstance(fieldInstance, value) {
const { id, expressionContextInfo } = fieldInstance;
const { id, expressionContextInfo } = fieldInstance || { id: '' };

const field = this._formFieldRegistry.get(id);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class UpdateFieldInstanceValidationHandler {

execute(context) {
const { fieldInstance, value } = context;
const { id, indexes } = fieldInstance;
const { id, indexes } = fieldInstance || { id: '' };
const { errors } = this._form._getState();

context.oldErrors = clone(errors);
Expand Down

0 comments on commit 3ce4054

Please sign in to comment.