Check validity of control item (#17349)

This commit is contained in:
Geido
2021-11-05 12:56:03 +02:00
committed by GitHub
parent e5fe18660c
commit d0085b1b29

View File

@@ -29,6 +29,7 @@ import {
ControlState,
ControlType,
ControlValueValidator,
CustomControlItem,
} from '@superset-ui/chart-controls';
import { getSectionsToRender } from './getSectionsToRender';
import { getControlConfig } from './getControlConfig';
@@ -160,8 +161,8 @@ export function getAllControlsState(
const controlsState = {};
getSectionsToRender(vizType, datasourceType).forEach(section =>
section.controlSetRows.forEach(fieldsetRow =>
fieldsetRow.forEach(field => {
if (field && 'config' in field && field.config && field.name) {
fieldsetRow.forEach((field: CustomControlItem) => {
if (field && field.config && field.name) {
const { config, name } = field;
controlsState[name] = getControlStateFromControlConfig(
config,