From c0a7c3537aadd0eea6e63017c8e0007115faf594 Mon Sep 17 00:00:00 2001 From: Naoki Takezoe Date: Fri, 27 Apr 2018 08:35:10 +0900 Subject: [PATCH] Fix MatchError for CommitComment --- .../scala/gitbucket/core/service/PullRequestService.scala | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/scala/gitbucket/core/service/PullRequestService.scala b/src/main/scala/gitbucket/core/service/PullRequestService.scala index 0f3398906..2972ffa47 100644 --- a/src/main/scala/gitbucket/core/service/PullRequestService.scala +++ b/src/main/scala/gitbucket/core/service/PullRequestService.scala @@ -334,8 +334,10 @@ trait PullRequestService { self: IssuesService with CommitsService => } .toSeq .map { + // Normal comment case ((Some(_), _, _, _), comments) => comments.head + // Comment on a specific line of a commit case ((None, Some(fileName), _, _), comments) => gitbucket.core.model.CommitComments( fileName = fileName, @@ -343,6 +345,9 @@ trait PullRequestService { self: IssuesService with CommitsService => registeredDate = comments.head.registeredDate, comments = comments.map(_.asInstanceOf[CommitComment]) ) + // Comment on a specific commit + case (_, comments) => + comments.head // TODO In this case, something wrong in the presentation of the comments list. } .sortWith(_.registeredDate before _.registeredDate) }