diff --git a/superset-frontend/src/reports/actions/reports.js b/superset-frontend/src/reports/actions/reports.js index 6fbd8ca4ec..96a435ec5d 100644 --- a/superset-frontend/src/reports/actions/reports.js +++ b/superset-frontend/src/reports/actions/reports.js @@ -23,6 +23,7 @@ import { addDangerToast, addSuccessToast, } from 'src/components/MessageToasts/actions'; +import { isEmpty } from 'lodash'; export const SET_REPORT = 'SET_REPORT'; export function setReport(report, resourceId, creationMethod, filterField) { @@ -76,7 +77,7 @@ export function fetchUISpecificReport({ const structureFetchAction = (dispatch, getState) => { const state = getState(); const { user, dashboardInfo, charts, explore } = state; - if (dashboardInfo) { + if (!isEmpty(dashboardInfo)) { dispatch( fetchUISpecificReport({ userId: user.userId, @@ -89,7 +90,7 @@ const structureFetchAction = (dispatch, getState) => { const [chartArr] = Object.keys(charts); dispatch( fetchUISpecificReport({ - userId: explore.user.userId, + userId: explore.user?.userId || user?.userId, filterField: 'chart_id', creationMethod: 'charts', resourceId: charts[chartArr].id,