Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

Commit

Permalink
Merge pull request #68 from mikkopiu/master
Browse files Browse the repository at this point in the history
BitbucketClient: prevent NPE when comment is deleted
  • Loading branch information
mrueegg authored Dec 15, 2017
2 parents 0a2b07f + 6ae0f65 commit f60cbea
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ class BitbucketClient(config: SonarBBPluginConfig) {
def findOwnPullRequestComments(pullRequest: PullRequest): Seq[PullRequestComment] = {

def isFromUs(comment: Map[String, Any]): Boolean =
comment("user").asInstanceOf[Map[String, Any]]("uuid").asInstanceOf[String] equals uuid
Option(comment("user").asInstanceOf[Map[String, Any]])
.getOrElse(Map("uuid" -> ""))("uuid").asInstanceOf[String] equals uuid

def fetchPullRequestCommentsPage(start: Int): (Option[Int], Seq[PullRequestComment]) = {
fetchPage(s"/pullrequests/${pullRequest.id}/comments", f =
Expand Down

0 comments on commit f60cbea

Please sign in to comment.