From 892e1b8745d988d782c0adf1305dac486408ad02 Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Thu, 17 Oct 2024 00:46:39 -0700 Subject: [PATCH] Allow for null to be passed to `doSafeRestart` --- 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 dc2c7926f605..8f4301410674 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); } /** @@ -4700,7 +4700,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); }