Skip to content

Commit

Permalink
Check validity of control item (#17349)
Browse files Browse the repository at this point in the history
(cherry picked from commit d0085b1)
  • Loading branch information
geido authored and eschutho committed Jan 12, 2022
1 parent 75d8006 commit a222ba8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions superset-frontend/src/explore/controlUtils/getControlState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
ControlState,
ControlType,
ControlValueValidator,
CustomControlItem,
} from '@superset-ui/chart-controls';
import { getSectionsToRender } from './getSectionsToRender';
import { getControlConfig } from './getControlConfig';
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit a222ba8

Please sign in to comment.