You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by zr...@apache.org on 2018/11/14 15:29:42 UTC
[camel] branch master updated: CAMEL-12926: fixed null pointer
exceptions accessing swagger url in blueprint projects
This is an automated email from the ASF dual-hosted git repository.
zregvart pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new aa1bd3e2 CAMEL-12926: fixed null pointer exceptions accessing swagger url in blueprint projects
aa1bd3e2 is described below
commit aa1bd3e25e1ba41d5ba9af17c5b6238c0566c42d
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 dbbcb90..b549634 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"));