diff --git a/src/renderer/features/workspace/mappers.ts b/src/renderer/features/workspace/mappers.ts index 390c8c04..e8e56d8a 100644 --- a/src/renderer/features/workspace/mappers.ts +++ b/src/renderer/features/workspace/mappers.ts @@ -39,7 +39,6 @@ export const mapToGlobalSettingsFormValues = (cfg: IWorkspaceCfg): GlobalSetting HTTPS_PROXY, IGNORE_CERT_ERRORS, } = cfg; - const defaultApi = APIS && APIS[DEFAULT_API_INDEX] ? APIS[DEFAULT_API_INDEX] : null; const hasNoProxy = !HTTP_PROXY && !PAC_PROXY; @@ -52,9 +51,9 @@ export const mapToGlobalSettingsFormValues = (cfg: IWorkspaceCfg): GlobalSetting const sameConfigAsHttp = httpHost === httpsHost && httpPort === httpsPort; return { - apiKey: defaultApi.API_KEY, + apiKey: defaultApi?.API_KEY, apis: APIS || [], - apiUrl: defaultApi.URL, + apiUrl: defaultApi?.URL, language: LNG, sbomLedgerToken: TOKEN, proxyConfig: {