Skip to content

Commit

Permalink
fix optional chaining in field count check
Browse files Browse the repository at this point in the history
  • Loading branch information
tyrasd authored May 11, 2023
1 parent d1bb56b commit df518d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ function validatePresetFields(presets, fields) {
// Fields with `prerequisiteTag` or `geometry` may not always be shown,
// so don't count them against the limits.
const alwaysShownFields = preset.fields.filter(fieldID => {
if (fields[fieldID] && fields[fieldID].prerequisiteTag || fields[fieldID].geometry) return false;
if (fields[fieldID]?.prerequisiteTag || fields[fieldID]?.geometry) return false;
return true;
});
fieldCount = alwaysShownFields.length;
Expand Down

0 comments on commit df518d4

Please sign in to comment.