Skip to content

Commit ad6f50f

Browse files
committed
Add null check for handler
1 parent 4a8eba2 commit ad6f50f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

web/src/main/java/com/microsoft/applicationinsights/web/internal/WebRequestTrackingFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public final class WebRequestTrackingFilter implements Filter {
117117
* @throws ServletException Exception that can be thrown from invoking the filters chain.
118118
*/
119119
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
120-
if (req instanceof HttpServletRequest && res instanceof HttpServletResponse) {
120+
if (handler != null && req instanceof HttpServletRequest && res instanceof HttpServletResponse) {
121121
HttpServletRequest httpRequest = (HttpServletRequest) req;
122122
HttpServletResponse httpResponse = (HttpServletResponse) res;
123123
boolean hasAlreadyBeenFiltered = httpRequest.getAttribute(ALREADY_FILTERED) != null;

0 commit comments

Comments
 (0)