-
Notifications
You must be signed in to change notification settings - Fork 72
NullPointerException when fetching pull request with deleted comments #67
Comments
I'm not too familiar with Scala, would this be an idiomatic fix: def isFromUs(comment: Map[String, Any]): Boolean = {
val user = comment("user").asInstanceOf[Map[String, Any]]
if (user == null) false else user("uuid").asInstanceOf[String] equals uuid
} or possibly: def isFromUs(comment: Map[String, Any]): Boolean =
Option(comment("user").asInstanceOf[Map[String, Any]])
.getOrElse(Map("uuid" -> null))("uuid").asInstanceOf[String] equals uuid ? |
We are having the exact same issue. Plugin version: 1.2.1 |
same issue here |
Same issue Plugin version: 1.2.1 |
I experience the same issue |
After updating the plugin to 1.2.2 I still get the same issue:
|
@mikkopiu from what I see in the change log, the fix should be already there: |
Oh, so did you build your own version from |
@mikkopiu sorry, I've used a wrong diff. You are right, this is not released yet. Do you have any estimations of the next release? |
You could clone (or download the zip of) the master branch, and on the root run a Of course this requires you to have a JDK and Maven installed. |
I'll try to release a new version today. |
@kmalmur I've just created a new release 1.2.3. Please build a JAR from this release with |
Will there be a release JAR for this like there was for 1.2.1 and before or do we need to build it ourselves? |
When will this be released? |
Expected Behavior
SonarQube Scanner in Jenkins (using this plugin) should update Bitbucket pull request comments with new scan statuses.
Actual Behavior
Received
NullPointerException
with stack trace:Plug-in version, SonarQube version, CI system, build type
The NPE is coming from this line: https://github.com/mibexsoftware/sonar-bitbucket-plugin/blob/v1.2.1/src/main/scala/ch/mibex/bitbucket/sonar/client/BitbucketClient.scala#L145
and when I tested the Bitbucket API endpoint it (
fetchPage
) is using (https://api.bitbucket.org/2.0/repositories/{account}/{repoSlug}/pullrequests/{prId}/comments
), I noticed that deleted comments are returned with auser
value ofnull
, e.g.:I assume this bit then fails because
user
isnull
, and therefore cannot have a propertyuuid
:It sounds like something has changed in the Bitbucket REST API but I wasn't able to find any changelogs etc. describing such a change. This has been working fine so far, started happening today.
The text was updated successfully, but these errors were encountered: