From: Julien HENRY Date: Tue, 17 Mar 2015 08:29:38 +0000 (+0100) Subject: SONAR-6276 Fix NPE when an event has no description X-Git-Tag: 5.2-RC1~2557 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1ba8493639f34fb68876004d85ece836e6ab33c4;p=sonarqube.git SONAR-6276 Fix NPE when an event has no description --- diff --git a/sonar-batch/src/main/java/org/sonar/batch/report/EventCache.java b/sonar-batch/src/main/java/org/sonar/batch/report/EventCache.java index 2cb2814d2ee..387050f280e 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/report/EventCache.java +++ b/sonar-batch/src/main/java/org/sonar/batch/report/EventCache.java @@ -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);