Skip to content

Commit

Permalink
fix: #685
Browse files Browse the repository at this point in the history
  • Loading branch information
wyouflf committed Feb 7, 2020
1 parent 76f0859 commit 958c5b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xutils/src/main/java/org/xutils/http/BaseParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public void addQueryStringParameter(String name, Object value) {
for (int i = 0; i < len; i++) {
this.queryStringParams.add(new ArrayItem(name, array.opt(i)));
}
} else if (value.getClass().isArray()) {
} else if (value != null && value.getClass().isArray()) {
int len = Array.getLength(value);
for (int i = 0; i < len; i++) {
this.queryStringParams.add(new ArrayItem(name, Array.get(value, i)));
Expand Down Expand Up @@ -197,7 +197,7 @@ public void addBodyParameter(String name, Object value, String contentType, Stri
}
} else if (value instanceof byte[]) {
this.bodyParams.add(new KeyValue(name, value));
} else if (value.getClass().isArray()) {
} else if (value != null && value.getClass().isArray()) {
int len = Array.getLength(value);
for (int i = 0; i < len; i++) {
this.bodyParams.add(new ArrayItem(name, Array.get(value, i)));
Expand Down

0 comments on commit 958c5b7

Please sign in to comment.