diff --git a/src/plugins/visualizations/public/visualize_app/components/visualize_top_nav.tsx b/src/plugins/visualizations/public/visualize_app/components/visualize_top_nav.tsx index 6e9ea7f7c3ff4..7e8bf9002af35 100644 --- a/src/plugins/visualizations/public/visualize_app/components/visualize_top_nav.tsx +++ b/src/plugins/visualizations/public/visualize_app/components/visualize_top_nav.tsx @@ -309,9 +309,9 @@ const TopNav = ({ showQueryInput={showQueryInput} showSaveQuery={Boolean(services.visualizeCapabilities.saveQuery)} dataViewPickerComponentProps={ - shouldShowDataViewPicker + shouldShowDataViewPicker && vis.data.indexPattern ? { - currentDataViewId: vis.data?.indexPattern?.id, + currentDataViewId: vis.data.indexPattern.id, trigger: { label: isMissingCurrentDataView ? i18n.translate('visualizations.fallbackDataView.label', { @@ -326,7 +326,7 @@ const TopNav = ({ }), }, }) - : vis.data?.indexPattern?.getName(), + : vis.data.indexPattern.getName(), }, isMissingCurrent: isMissingCurrentDataView, onChangeDataView,