diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java index dc2c7926f605f..1fde3987272d9 100644 --- a/core/src/main/java/jenkins/model/Jenkins.java +++ b/core/src/main/java/jenkins/model/Jenkins.java @@ -4667,7 +4667,7 @@ public void generateNotFoundResponse(StaplerRequest2 req, StaplerResponse2 rsp) */ @Deprecated(since = "2.414") public HttpResponse doSafeRestart(StaplerRequest req) throws IOException, ServletException, RestartNotSupportedException { - return doSafeRestart(StaplerRequest.toStaplerRequest2(req), null); + return doSafeRestart(req != null ? StaplerRequest.toStaplerRequest2(req) : null, null); } /**