]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6276 Fix NPE when an event has no description
authorJulien HENRY <julien.henry@sonarsource.com>
Tue, 17 Mar 2015 08:29:38 +0000 (09:29 +0100)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Tue, 17 Mar 2015 11:16:34 +0000 (12:16 +0100)
sonar-batch/src/main/java/org/sonar/batch/report/EventCache.java

index 2cb2814d2ee2f4b3fce0acb15d4a57900d75e78c..387050f280eccaaf17c152290afec7ca0c190bde 100644 (file)
@@ -38,10 +38,12 @@ public class EventCache implements BatchComponent {
     this.resourceCache = resourceCache;
   }
 
-  public void createEvent(Resource resource, String name, String description, EventCategory category, @Nullable String data) {
+  public void createEvent(Resource resource, String name, @Nullable String description, EventCategory category, @Nullable String data) {
     org.sonar.batch.protocol.output.BatchReport.Event.Builder eventBuilder = org.sonar.batch.protocol.output.BatchReport.Event.newBuilder();
     eventBuilder.setName(name);
-    eventBuilder.setDescription(description);
+    if (description != null) {
+      eventBuilder.setDescription(description);
+    }
     eventBuilder.setCategory(category);
     if (data != null) {
       eventBuilder.setEventData(data);