Skip to content

Commit e0de03a

Browse files
author
Javen
committed
Fix bug reported by findBugs
1 parent f71c0e7 commit e0de03a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/cn/jpush/api/utils/StringUtils.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ public static String encodeParam(String param) {
4949
}
5050

5151
public static String arrayToString(String[] values) {
52+
if (null == values) return "";
53+
5254
StringBuffer buffer = new StringBuffer(values.length);
53-
if (values != null) {
54-
for (int i = 0; i < values.length; i++) {
55-
buffer.append(values[i]).append(",");
56-
}
55+
for (int i = 0; i < values.length; i++) {
56+
buffer.append(values[i]).append(",");
5757
}
5858
if (buffer.length() > 0) {
5959
return buffer.toString().substring(0, buffer.length() - 1);

0 commit comments

Comments
 (0)