Skip to content

Commit 89818f0

Browse files
committed
Handle missing slotTitle cases in fields.js
1 parent daacbcf commit 89818f0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/utils/fields.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,12 @@ export function slotNamesForTitlesMap(fields) {
187187
const fieldSymbolsAtIndex = fieldSymbolsAtIndexMap(fields);
188188
let tempObject = {};
189189
for (let index in fieldSymbolsAtIndex) {
190-
tempObject[fieldSymbolsAtIndex[index].slotTitle] =
191-
fieldSymbolsAtIndex[index].slotName;
190+
const slotName = fieldSymbolsAtIndex[index].slotName;
191+
let slotTitle = fieldSymbolsAtIndex[index].slotTitle;
192+
// If slotTitle not specified; use slotName as slotTitle
193+
slotTitle = slotTitle === undefined ? slotName : slotTitle;
194+
195+
tempObject[slotTitle] = slotName;
192196
}
193197
return tempObject;
194198
}

0 commit comments

Comments
 (0)