diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2015-03-17 09:29:38 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-03-17 12:16:34 +0100 |
commit | 1ba8493639f34fb68876004d85ece836e6ab33c4 (patch) | |
tree | 5acd594e6daadf1c8269a94b0864436d6b84d5e1 | |
parent | ffcece8c7b623560d59410a07421a620edd3a1b9 (diff) | |
download | sonarqube-1ba8493639f34fb68876004d85ece836e6ab33c4.tar.gz sonarqube-1ba8493639f34fb68876004d85ece836e6ab33c4.zip |
SONAR-6276 Fix NPE when an event has no description
-rw-r--r-- | sonar-batch/src/main/java/org/sonar/batch/report/EventCache.java | 6 |
1 files 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); |