diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/ElasticSearchIndexPage/ElasticSearchReIndexPage.component.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/ElasticSearchIndexPage/ElasticSearchReIndexPage.component.tsx index 3a33f105ade..7d39d5bb16f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/ElasticSearchIndexPage/ElasticSearchReIndexPage.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/ElasticSearchIndexPage/ElasticSearchReIndexPage.component.tsx @@ -75,11 +75,13 @@ const ElasticSearchIndexPage = () => { }; const stopBatchReIndexedJob = async () => { - try { - const response = await stopBatchJobReIndex(batchJobData?.id); - showSuccessToast(jsonData['api-success-messages']['stop-re-index']); - } catch (error) { - showErrorToast(error as AxiosError); + if (batchJobData) { + try { + await stopBatchJobReIndex(batchJobData.id); + showSuccessToast(jsonData['api-success-messages']['stop-re-index']); + } catch (error) { + showErrorToast(error as AxiosError); + } } };