You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2018/12/03 14:52:45 UTC

[camel] 01/03: CAMEL-12926: fixed null pointer exceptions accessing swagger url in blueprint projects

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch sandbox/camel-3.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit de087b5704e49c20282eb373d21fcce8c29f5db7
Author: Andrea Tarocchi <at...@redhat.com>
AuthorDate: Wed Nov 14 16:12:20 2018 +0100

    CAMEL-12926: fixed null pointer exceptions accessing swagger url in blueprint projects
---
 .../src/main/java/org/apache/camel/swagger/RestSwaggerSupport.java     | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/RestSwaggerSupport.java b/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/RestSwaggerSupport.java
index 838356e..2bda5451 100644
--- a/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/RestSwaggerSupport.java
+++ b/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/RestSwaggerSupport.java
@@ -18,6 +18,7 @@ package org.apache.camel.swagger;
 
 import java.lang.management.ManagementFactory;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -210,7 +211,7 @@ public class RestSwaggerSupport {
 
         List<RestDefinition> rests = getRestDefinitions(contextId);
         if (rests != null) {
-            final Map<String, Object> apiProperties = configuration.getApiProperties();
+            final Map<String, Object> apiProperties = configuration.getApiProperties() != null ? configuration.getApiProperties() : new HashMap<>();
             if (json) {
                 response.setHeader(Exchange.CONTENT_TYPE, (String) apiProperties.getOrDefault("api.specification.contentType.json", "application/json"));