Skip to content

Commit decbf40

Browse files
authored
Merge pull request #77 from aquasecurity/bugfix/azure-out-of-range-exception
2 parents 844341a + 6eab2cb commit decbf40

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pkg/commenter/azure/azure.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,14 @@ func (c *Azure) WriteMultiLineComment(file, comment string, startLine, endLine i
7373
file = fmt.Sprintf("/%s", file)
7474
}
7575

76-
if startLine == commenter.FIRST_AVAILABLE_LINE {
77-
startLine = 0
76+
if startLine == commenter.FIRST_AVAILABLE_LINE || startLine == 0 {
77+
// Reference: https://developercommunity.visualstudio.com/t/Adding-thread-to-PR-using-REST-API-cause/10598424
78+
startLine = 1
7879
}
7980

80-
if endLine == commenter.FIRST_AVAILABLE_LINE {
81-
endLine = 0
81+
if endLine == commenter.FIRST_AVAILABLE_LINE || endLine == 0 {
82+
// Reference: https://developercommunity.visualstudio.com/t/Adding-thread-to-PR-using-REST-API-cause/10598424
83+
endLine = 1
8284
}
8385

8486
b := Body{

0 commit comments

Comments
 (0)