I have implemented SlingRequestFilter for restricted DAM access. However, launches functionality in AEM has stopped working because of null pointer exception thrown at below line in bold. Could you please advise how I can resolve this or what possible scenario is throwing this exception.
_// Forcing false in this sample so else this will break AEM when installed
if (false && response.getContentType().contains("html")) {
// In this example, checking for html response type since the comments are HTML format and would break
// binary, json, etc. responses
// Write some more content to the response before this chain has executed
//response.getWriter().write("<!-- Written from the Sample Sling Filter BEFORE the next include -->");
// Proceed with the rest of the Filter chain
chain.doFilter(request, response);
// Write some more content to the response after this chain has executed
//response.getWriter().write("<!-- Written from the Sample Sling Filter AFTER the next include -->");
} else {
**chain.doFilter(request, response);**
}
Log file attached.