diff --git a/src/pages/workspace/companyCards/addNew/BankConnection/index.tsx b/src/pages/workspace/companyCards/addNew/BankConnection/index.tsx index 0a399a9473c8..f765647fe1fc 100644 --- a/src/pages/workspace/companyCards/addNew/BankConnection/index.tsx +++ b/src/pages/workspace/companyCards/addNew/BankConnection/index.tsx @@ -34,8 +34,8 @@ function BankConnection({policyID}: BankConnectionStepProps) { const workspaceAccountID = PolicyUtils.getWorkspaceAccountID(policyID ?? '-1'); const [cardFeeds] = useOnyx(`${ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_DOMAIN_MEMBER}${workspaceAccountID}`); const bankKey = Object.keys(CONST.COMPANY_CARDS.BANKS).find((value) => CONST.COMPANY_CARDS.BANKS[value] === bankName); - const feedName = CONST.COMPANY_CARD.FEED_BANK_NAME[bankKey]; - const connectedBank = cardFeeds?.settings?.oAuthAccountDetails?.[feedName] ?? undefined; + const feedName = bankKey ? CONST.COMPANY_CARD.FEED_BANK_NAME?.[bankKey] : undefined; + const connectedBank = feedName ? cardFeeds?.settings?.oAuthAccountDetails?.[feedName] : undefined; const currentUrl = getCurrentUrl(); const isBankConnectionCompleteRoute = currentUrl.includes(ROUTES.BANK_CONNECTION_COMPLETE);