Skip to content

Commit

Permalink
Regression: Prevent parsing empty custom field setting (#15413)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcosSpessatto authored and sampaiodiego committed Sep 20, 2019
1 parent 98a013b commit 72aaeb3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/api/server/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,9 @@ settings.get('API_Enable_CORS', (key, value) => {
});

settings.get('Accounts_CustomFields', (key, value) => {
if (!value) {
return API.v1.setLimitedCustomFields([]);
}
try {
const customFields = JSON.parse(value);
const nonPublicCustomFields = Object.keys(customFields).filter((customFieldKey) => customFields[customFieldKey].public !== true);
Expand Down

0 comments on commit 72aaeb3

Please sign in to comment.