Skip to content

Commit

Permalink
Check validity of control item (apache#17349)
Browse files Browse the repository at this point in the history
(cherry picked from commit d0085b1)
  • Loading branch information
geido authored and sadpandajoe committed Nov 5, 2021
1 parent b148a69 commit ffc5686
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 ffc5686

Please sign in to comment.