From 0bbcfc5b3dbc314da0e0936d25626e24fef6835e Mon Sep 17 00:00:00 2001 From: Aniket Katkar Date: Mon, 10 Apr 2023 23:29:22 +0530 Subject: [PATCH] fixed console errors in the ui for ElasticSearchReIndexPage (#10982) --- .../ElasticSearchReIndexPage.component.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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); + } } };