Skip to content

Commit

Permalink
Check if diff actually contains sections when rendering (#9926) (#9933)
Browse files Browse the repository at this point in the history
  • Loading branch information
lafriks authored and zeripath committed Jan 22, 2020
1 parent 0dced15 commit f82a805
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion services/gitdiff/gitdiff.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ func (diffFile *DiffFile) GetHighlightClass() string {

// GetTailSection creates a fake DiffLineSection if the last section is not the end of the file
func (diffFile *DiffFile) GetTailSection(gitRepo *git.Repository, leftCommitID, rightCommitID string) *DiffSection {
if diffFile.Type != DiffFileChange || diffFile.IsBin || diffFile.IsLFSFile {
if len(diffFile.Sections) == 0 || diffFile.Type != DiffFileChange || diffFile.IsBin || diffFile.IsLFSFile {
return nil
}
leftCommit, err := gitRepo.GetCommit(leftCommitID)
Expand Down

0 comments on commit f82a805

Please sign in to comment.