Skip to content

Commit

Permalink
fix: only apply map fly to value if id exists
Browse files Browse the repository at this point in the history
  • Loading branch information
meenahoda committed Jun 16, 2022
1 parent 5333d8d commit ebde201
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ module.exports = async function extractDefaults (cardscript) {
break
case 'Map':
case 'Input.Map': {
applyDefaultValue(defaultValues, null, apiLookupPath, cardListPath, element.id + 'MapFlyTo')
if (element.id) {
applyDefaultValue(defaultValues, null, apiLookupPath, cardListPath, element.id + 'MapFlyTo')
}

const markers = element.markers ? [...element.markers] : []
if (element.centre && element.centre.show) markers.push(element.centre)
Expand Down
4 changes: 4 additions & 0 deletions test/extract-default-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ describe('Run some Cardscript default-extracting tests', function () {
cardListNonEditable: [],
toggle: false,
tabSetTabSet: 'tab-0',
tabSetTabSetShowWhens: [
undefined,
undefined
],
choice: 'CHOICE_1',
choiceMulti: ['CHOICE_1', 'CHOICE_2'],
choiceWithTitle: 'CHOICE_1',
Expand Down

0 comments on commit ebde201

Please sign in to comment.