Commit 8ffc1a70 authored by yihua.huang's avatar yihua.huang

add NPE check for POST method

parent 8551b668
...@@ -158,7 +158,7 @@ public class HttpClientDownloader extends AbstractDownloader { ...@@ -158,7 +158,7 @@ public class HttpClientDownloader extends AbstractDownloader {
} else if (method.equalsIgnoreCase(HttpConstant.Method.POST)) { } else if (method.equalsIgnoreCase(HttpConstant.Method.POST)) {
RequestBuilder requestBuilder = RequestBuilder.post(); RequestBuilder requestBuilder = RequestBuilder.post();
NameValuePair[] nameValuePair = (NameValuePair[]) request.getExtra("nameValuePair"); NameValuePair[] nameValuePair = (NameValuePair[]) request.getExtra("nameValuePair");
if (nameValuePair.length > 0) { if (nameValuePair != null && nameValuePair.length > 0) {
requestBuilder.addParameters(nameValuePair); requestBuilder.addParameters(nameValuePair);
} }
return requestBuilder; return requestBuilder;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment