[#1637] Check for null parameters
This commit is contained in:
parent
ec370e1d97
commit
dbc74fcc97
@ -66,6 +66,9 @@ public abstract class DefaultHttpMessage extends DefaultHttpObject implements Ht
|
||||
|
||||
@Override
|
||||
public HttpMessage setProtocolVersion(HttpVersion version) {
|
||||
if (version == null) {
|
||||
throw new NullPointerException("version");
|
||||
}
|
||||
this.version = version;
|
||||
return this;
|
||||
}
|
||||
|
@ -56,12 +56,18 @@ public class DefaultHttpRequest extends DefaultHttpMessage implements HttpReques
|
||||
|
||||
@Override
|
||||
public HttpRequest setMethod(HttpMethod method) {
|
||||
if (method == null) {
|
||||
throw new NullPointerException("method");
|
||||
}
|
||||
this.method = method;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpRequest setUri(String uri) {
|
||||
if (uri == null) {
|
||||
throw new NullPointerException("method");
|
||||
}
|
||||
this.uri = uri;
|
||||
return this;
|
||||
}
|
||||
|
@ -45,6 +45,9 @@ public class DefaultHttpResponse extends DefaultHttpMessage implements HttpRespo
|
||||
|
||||
@Override
|
||||
public HttpResponse setStatus(HttpResponseStatus status) {
|
||||
if (status == null) {
|
||||
throw new NullPointerException("status");
|
||||
}
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user