diff --git a/src/Platform/Hosted/Components/SwitchAccount.tsx b/src/Platform/Hosted/Components/SwitchAccount.tsx index 0462f2188..ef195ee07 100644 --- a/src/Platform/Hosted/Components/SwitchAccount.tsx +++ b/src/Platform/Hosted/Components/SwitchAccount.tsx @@ -26,7 +26,7 @@ export const SwitchAccount: FunctionComponent = ({ data: account, }))} onChange={(_, option) => { - setSelectedAccountName(String(option.key)); + setSelectedAccountName(String(option?.key)); dismissMenu(); }} defaultSelectedKey={selectedAccount?.name} diff --git a/src/Platform/Hosted/Components/SwitchSubscription.tsx b/src/Platform/Hosted/Components/SwitchSubscription.tsx index 9ec98fc27..c784c5f5b 100644 --- a/src/Platform/Hosted/Components/SwitchSubscription.tsx +++ b/src/Platform/Hosted/Components/SwitchSubscription.tsx @@ -26,7 +26,7 @@ export const SwitchSubscription: FunctionComponent = ({ }; })} onChange={(_, option) => { - setSelectedSubscriptionId(String(option.key)); + setSelectedSubscriptionId(String(option?.key)); }} defaultSelectedKey={selectedSubscription?.subscriptionId} placeholder={subscriptions && subscriptions.length === 0 ? "No Subscriptions Found" : "Select a Subscription"} diff --git a/tsconfig.strict.json b/tsconfig.strict.json index ade4b2017..6a9a6e78a 100644 --- a/tsconfig.strict.json +++ b/tsconfig.strict.json @@ -140,7 +140,9 @@ "./src/quickstart.ts", "./src/setupTests.ts", "./src/userContext.test.ts", - "src/Common/EntityValue.tsx" + "src/Common/EntityValue.tsx", + "./src/Platform/Hosted/Components/SwitchAccount.tsx", + "./src/Platform/Hosted/Components/SwitchSubscription.tsx", ], "include": [ "src/CellOutputViewer/transforms/**/*",