Skip to content

Commit

Permalink
Add nullchecks
Browse files Browse the repository at this point in the history
  • Loading branch information
kgabryje committed Nov 18, 2024
1 parent be4b6dc commit 75fc7f2
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,10 @@ const Chart = props => {

const logExploreChart = useCallback(() => {
boundActionCreators.logEvent(LOG_ACTIONS_EXPLORE_DASHBOARD_CHART, {
slice_id: slice.slice_id,
slice_id: slice?.slice_id,
is_cached: props.isCached,
});
}, [boundActionCreators.logEvent, slice.slice_id, props.isCached]);
}, [boundActionCreators.logEvent, slice?.slice_id, props.isCached]);

const onExploreChart = useCallback(
async clickEvent => {
Expand All @@ -252,12 +252,12 @@ const Chart = props => {
datasource.id,
datasource.type,
props.formData,
slice.slice_id,
slice?.slice_id,
nextTabId,
);
const url = mountExploreUrl(null, {
[URL_PARAMS.formDataKey.name]: key,
[URL_PARAMS.sliceId.name]: slice.slice_id,
[URL_PARAMS.sliceId.name]: slice?.slice_id,
});
if (isOpenInNewTab) {
window.open(url, '_blank', 'noreferrer');
Expand All @@ -275,7 +275,7 @@ const Chart = props => {
datasource.id,
datasource.type,
props.formData,
slice.slice_id,
slice?.slice_id,
boundActionCreators.addDangerToast,
history,
],
Expand All @@ -288,7 +288,7 @@ const Chart = props => {
? LOG_ACTIONS_EXPORT_CSV_DASHBOARD_CHART
: LOG_ACTIONS_EXPORT_XLSX_DASHBOARD_CHART;
boundActionCreators.logEvent(logAction, {
slice_id: slice.slice_id,
slice_id: slice?.slice_id,
is_cached: props.isCached,
});
exportChart({
Expand All @@ -302,7 +302,7 @@ const Chart = props => {
});
},
[
slice.slice_id,
slice?.slice_id,
props.isCached,
props.formData,
props.maxRows,
Expand Down Expand Up @@ -336,15 +336,15 @@ const Chart = props => {

const forceRefresh = useCallback(() => {
boundActionCreators.logEvent(LOG_ACTIONS_FORCE_REFRESH_CHART, {
slice_id: slice.slice_id,
slice_id: slice?.slice_id,
is_cached: props.isCached,
});
return boundActionCreators.refreshChart(chart.id, true, props.dashboardId);
}, [
boundActionCreators.refreshChart,
chart.id,
props.dashboardId,
slice.slice_id,
slice?.slice_id,
props.isCached,
boundActionCreators.logEvent,
]);
Expand Down

0 comments on commit 75fc7f2

Please sign in to comment.