Skip to content

Commit 8ef1f37

Browse files
authored
sonarqube:9.0.0-community branch list api doesn't return commit info (#9)
* Update sonarqube.ts * revise per comment
1 parent b4c199f commit 8ef1f37

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export interface Branch {
113113
codeSmells?: number
114114
}
115115
analysisDate: string
116-
commit: {
116+
commit?: {
117117
sha: string
118118
author: {
119119
name: string

src/sonarqube.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export function activate(context: sourcegraph.ExtensionContext): void {
104104
}
105105

106106
const branches = await listBranches({ project, ...apiOptions })
107-
const branch = branches.find(branch => branch.commit.sha === commitID)
107+
const branch = branches.find(branch => branch?.commit?.sha === commitID)
108108
if (!branch) {
109109
console.warn(
110110
`No Sonarqube branch found for commit ID ${commitID}, falling back to default branch`

0 commit comments

Comments
 (0)