resolves crash for table cell types expecting input type array (#2665)

This commit is contained in:
Arpit 2022-04-06 14:13:43 +05:30 committed by GitHub
parent 67a8e2019a
commit e64a273b0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -323,10 +323,11 @@ export function Table({
columnType === 'badges' ||
columnType === 'radio'
) {
const values = resolveReferences(column.values, currentState) || [];
const labels = resolveReferences(column.labels, currentState, []) || [];
columnOptions.selectOptions = [];
const values = resolveReferences(column.values, currentState, []);
const labels = resolveReferences(column.labels, currentState, []);
if (Array.isArray(labels)) {
if (Array.isArray(labels) && Array.isArray(values)) {
columnOptions.selectOptions = labels.map((label, index) => {
return { name: label, value: values[index] };
});