[#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
|
@Override
|
||||||
public HttpMessage setProtocolVersion(HttpVersion version) {
|
public HttpMessage setProtocolVersion(HttpVersion version) {
|
||||||
|
if (version == null) {
|
||||||
|
throw new NullPointerException("version");
|
||||||
|
}
|
||||||
this.version = version;
|
this.version = version;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -56,12 +56,18 @@ public class DefaultHttpRequest extends DefaultHttpMessage implements HttpReques
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpRequest setMethod(HttpMethod method) {
|
public HttpRequest setMethod(HttpMethod method) {
|
||||||
|
if (method == null) {
|
||||||
|
throw new NullPointerException("method");
|
||||||
|
}
|
||||||
this.method = method;
|
this.method = method;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpRequest setUri(String uri) {
|
public HttpRequest setUri(String uri) {
|
||||||
|
if (uri == null) {
|
||||||
|
throw new NullPointerException("method");
|
||||||
|
}
|
||||||
this.uri = uri;
|
this.uri = uri;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,9 @@ public class DefaultHttpResponse extends DefaultHttpMessage implements HttpRespo
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpResponse setStatus(HttpResponseStatus status) {
|
public HttpResponse setStatus(HttpResponseStatus status) {
|
||||||
|
if (status == null) {
|
||||||
|
throw new NullPointerException("status");
|
||||||
|
}
|
||||||
this.status = status;
|
this.status = status;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user