Skip to content

Commit

Permalink
Fix "undefined is not iterable" (#1358)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhyskoedijk authored Sep 28, 2024
1 parent 45fc539 commit 618968d
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,20 @@ export class AzureDevOpsWebApiClient {
},
project,
);
if (!pullRequests || pullRequests.length === 0) {
return [];
}

return await Promise.all(
pullRequests?.map(async (pr) => {
const properties = (await git.getPullRequestProperties(repository, pr.pullRequestId, project))?.value;
pullRequests.map(async (pr) => {
const properties = (await git.getPullRequestProperties(repository, pr.pullRequestId, project))?.value || {};
return {
id: pr.pullRequestId,
properties:
Object.keys(properties)?.map((key) => {
Object.keys(properties).map((key) => {
return {
name: key,
value: properties[key].$value,
value: properties[key]?.$value,
};
}) || [],
};
Expand Down

0 comments on commit 618968d

Please sign in to comment.