cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject cxf git commit: [CXF-6601] avoid NPE; this closes #90
Date Wed, 23 Sep 2015 19:27:12 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 5800f47a1 -> ac28733c0


[CXF-6601] avoid NPE; this closes #90


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/ac28733c
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/ac28733c
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/ac28733c

Branch: refs/heads/3.0.x-fixes
Commit: ac28733c09f140f68b6d670ceb0c9fdcc51ac860
Parents: 5800f47
Author: David J. M. Karlsen <david@davidkarlsen.com>
Authored: Tue Sep 22 09:12:04 2015 +0200
Committer: Akitoshi Yoshida <ay@apache.org>
Committed: Wed Sep 23 21:26:27 2015 +0200

----------------------------------------------------------------------
 .../main/java/org/apache/cxf/jaxrs/swagger/Swagger2Feature.java  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/ac28733c/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Feature.java
----------------------------------------------------------------------
diff --git a/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Feature.java
b/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Feature.java
index 432b08f..7a68622 100644
--- a/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Feature.java
+++ b/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Feature.java
@@ -25,6 +25,7 @@ import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Set;
 
+import javax.servlet.ServletContext;
 import javax.ws.rs.container.ContainerRequestContext;
 import javax.ws.rs.container.ContainerRequestFilter;
 import javax.ws.rs.container.PreMatching;
@@ -174,7 +175,8 @@ public class Swagger2Feature extends AbstractSwaggerFeature {
 
         @Override
         public void filter(ContainerRequestContext requestContext) throws IOException {
-            if (mc.getServletContext().getAttribute(ReaderConfig.class.getName()) == null)
{
+            ServletContext servletContext = mc.getServletContext();
+            if (servletContext != null && servletContext.getAttribute(ReaderConfig.class.getName())
== null) {
                 if (mc.getServletConfig() != null
                     && Boolean.valueOf(mc.getServletConfig().getInitParameter("scan.all.resources")))
{
                     addReaderConfig(mc.getServletConfig().getInitParameter("ignore.routes"));


Mime
View raw message