Skip to content

Commit

Permalink
NPE from ConfigurationAsCode.handleExceptionOnReloading (#2534)
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick authored Jul 18, 2024
1 parent 3a0b616 commit ccda4a1
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
import java.util.logging.Logger;
import java.util.stream.IntStream;
import java.util.stream.Stream;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletResponse;
Expand Down Expand Up @@ -204,7 +205,10 @@ public static void handleExceptionOnReloading(
}
request.setAttribute("invalidAttribute", cause.getInvalidAttribute());
request.setAttribute("validAttributes", cause.getValidAttributes());
request.getView(ConfigurationAsCode.class, "error.jelly").forward(request, response);
RequestDispatcher view = request.getView(ConfigurationAsCode.class, "error.jelly");
if (view != null) {
view.forward(request, response);
}
}

@RequirePOST
Expand Down

0 comments on commit ccda4a1

Please sign in to comment.