From 6c5cdfa96c5bc7dd0325d792a2a31700b72b6d54 Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Mon, 21 Oct 2024 11:37:27 -0700 Subject: [PATCH] Allow for null to be passed to `doSafeRestart` (#9882) --- core/src/main/java/jenkins/model/Jenkins.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java index 4391b1547dab..6db36176c6c2 100644 --- a/core/src/main/java/jenkins/model/Jenkins.java +++ b/core/src/main/java/jenkins/model/Jenkins.java @@ -4668,7 +4668,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); } /** @@ -4701,7 +4701,7 @@ public HttpResponse doSafeRestart(StaplerRequest2 req, @QueryParameter("message" @StaplerNotDispatchable public HttpResponse doSafeRestart(StaplerRequest req, @QueryParameter("message") String message) throws IOException, javax.servlet.ServletException, RestartNotSupportedException { try { - return doSafeRestart(StaplerRequest.toStaplerRequest2(req), message); + return doSafeRestart(req != null ? StaplerRequest.toStaplerRequest2(req) : null, message); } catch (ServletException e) { throw ServletExceptionWrapper.fromJakartaServletException(e); }