Skip to content

Commit 958c5b7

Browse files
committed
fix: #685
1 parent 76f0859 commit 958c5b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

xutils/src/main/java/org/xutils/http/BaseParams.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public void addQueryStringParameter(String name, Object value) {
143143
for (int i = 0; i < len; i++) {
144144
this.queryStringParams.add(new ArrayItem(name, array.opt(i)));
145145
}
146-
} else if (value.getClass().isArray()) {
146+
} else if (value != null && value.getClass().isArray()) {
147147
int len = Array.getLength(value);
148148
for (int i = 0; i < len; i++) {
149149
this.queryStringParams.add(new ArrayItem(name, Array.get(value, i)));
@@ -197,7 +197,7 @@ public void addBodyParameter(String name, Object value, String contentType, Stri
197197
}
198198
} else if (value instanceof byte[]) {
199199
this.bodyParams.add(new KeyValue(name, value));
200-
} else if (value.getClass().isArray()) {
200+
} else if (value != null && value.getClass().isArray()) {
201201
int len = Array.getLength(value);
202202
for (int i = 0; i < len; i++) {
203203
this.bodyParams.add(new ArrayItem(name, Array.get(value, i)));

0 commit comments

Comments
 (0)