From 9037c92b89de6bc49475dba1fd5d4bf882e3a8ac Mon Sep 17 00:00:00 2001 From: Pavel Zavora Date: Mon, 17 May 2021 08:39:40 +0200 Subject: [PATCH] chore: repair build by removing optional chaning --- ui/src/kapacitor/apis/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/src/kapacitor/apis/index.js b/ui/src/kapacitor/apis/index.js index a389627ba..cf3b56a12 100644 --- a/ui/src/kapacitor/apis/index.js +++ b/ui/src/kapacitor/apis/index.js @@ -72,8 +72,11 @@ export const getRule = async (kapacitor, ruleID) => { method: 'GET', url: `${kapacitor.links.rules}/${ruleID}`, }) - addUnderscoreType(response?.data?.alertNodes?.serviceNow) - addUnderscoreType(response?.data?.alertNodes?.zenoss) + const alertNodes = get(response, ['data', 'alertNodes']) + if (alertNodes) { + addUnderscoreType(alertNodes.serviceNow) + addUnderscoreType(alertNodes.zenoss) + } return response } catch (error) { console.error(error)