Skip to content
Permalink
Browse files
CXF-6601: avoid NPE
  • Loading branch information
davidkarlsen authored and elakito committed Sep 23, 2015
1 parent cb2160f commit 5c2d0981036a9c26e935b4748489d8898583d70c
Showing 1 changed file with 3 additions and 1 deletion.
@@ -25,6 +25,7 @@
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 @@ private class ReaderConfigFilter implements ContainerRequestFilter {

@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"));

0 comments on commit 5c2d098

Please sign in to comment.