Allow for null to be passed to `doSafeRestart` (#9882)

This commit is contained in:
Basil Crow 2024-10-21 11:37:27 -07:00 committed by GitHub
parent 5f7026dd03
commit 6c5cdfa96c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -4668,7 +4668,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve
*/
@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 class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve
@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);
}