From 1ba8493639f34fb68876004d85ece836e6ab33c4 Mon Sep 17 00:00:00 2001 From: Julien HENRY Date: Tue, 17 Mar 2015 09:29:38 +0100 Subject: SONAR-6276 Fix NPE when an event has no description --- sonar-batch/src/main/java/org/sonar/batch/report/EventCache.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); -- cgit v1.2.3