Skip to content

Commit

Permalink
fix: field type checks
Browse files Browse the repository at this point in the history
  • Loading branch information
hel-axelor committed May 3, 2024
1 parent 68cfd70 commit 7776601
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions packages/core/src/forms/studio/formula.helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,13 @@ export const mapStudioFieldsWithFormula = (
}));
};

export const getAttrsValue = (object: Object, fieldType: string) => {
export const getAttrsValue = (object: Object, fieldType?: string) => {
if (isEmpty(object)) {
return {};
}

if (
fieldType != null ||
object.hasOwnProperty(fieldType) ||
typeof object[fieldType] !== 'string'
) {
return JSON.parse(object[fieldType]);
if (fieldType != null) {
return object[fieldType] != null ? JSON.parse(object[fieldType]) : {};
}

let result = {};
Expand Down

0 comments on commit 7776601

Please sign in to comment.