aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorantoine.vinot <antoine.vinot@sonarsource.com>2024-04-05 11:31:23 +0200
committersonartech <sonartech@sonarsource.com>2024-04-05 20:02:38 +0000
commit118a1b07a78bb95a84defa9535f9999d8f4bd2c5 (patch)
treed98e9956f301aa6b9b446fb3f6dded40e5399add /sonar-core
parent54ad2b1a3d5746ed4702daa1a10845d7b27a0026 (diff)
downloadsonarqube-118a1b07a78bb95a84defa9535f9999d8f4bd2c5.tar.gz
sonarqube-118a1b07a78bb95a84defa9535f9999d8f4bd2c5.zip
SONAR-22009 Fix NPE on SARIF import when Extensions don't have Rules
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/sarif/Extension.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/sarif/Extension.java b/sonar-core/src/main/java/org/sonar/core/sarif/Extension.java
index d3acedeb88f..1e7b16c37bf 100644
--- a/sonar-core/src/main/java/org/sonar/core/sarif/Extension.java
+++ b/sonar-core/src/main/java/org/sonar/core/sarif/Extension.java
@@ -21,6 +21,7 @@ package org.sonar.core.sarif;
import com.google.gson.annotations.SerializedName;
import java.util.Set;
+import javax.annotation.CheckForNull;
public class Extension {
@SerializedName("rules")
@@ -33,6 +34,7 @@ public class Extension {
// http://stackoverflow.com/a/18645370/229031
}
+ @CheckForNull
public Set<Rule> getRules() {
return rules;
}