From 39860e00043da5856100fe59d9ce1abab26ca056 Mon Sep 17 00:00:00 2001 From: Rhys Koedijk Date: Fri, 27 Sep 2024 16:48:34 +1200 Subject: [PATCH] Fix "cannot read properties of null" --- .../dependabotV2/utils/azure-devops/AzureDevOpsWebApiClient.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extension/tasks/dependabotV2/utils/azure-devops/AzureDevOpsWebApiClient.ts b/extension/tasks/dependabotV2/utils/azure-devops/AzureDevOpsWebApiClient.ts index 95e9e5d9..97fe6cad 100644 --- a/extension/tasks/dependabotV2/utils/azure-devops/AzureDevOpsWebApiClient.ts +++ b/extension/tasks/dependabotV2/utils/azure-devops/AzureDevOpsWebApiClient.ts @@ -479,7 +479,7 @@ export class AzureDevOpsWebApiClient { const projects = await core.getProjects(); const projectGuid = projects?.find((p) => p.name === project)?.id; const properties = await core.getProjectProperties(projectGuid); - return properties.map((p) => ({ [p.name]: p.value })).reduce((a, b) => ({ ...a, ...b }), {}); + return properties?.map((p) => ({ [p.name]: p.value }))?.reduce((a, b) => ({ ...a, ...b }), {}); } catch (e) { error(`Failed to get project properties: ${e}`); console.debug(e); // Dump the error stack trace to help with debugging