Skip to content

Commit 0ebfcf7

Browse files
author
许丹侠
committed
修复导致序列化错误和空指针异常的BUG
1 parent 38f26bf commit 0ebfcf7

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@
3939
</scm>
4040

4141
<dependencies>
42-
<!--<dependency>-->
43-
<!--<groupId>cn.jpush.api</groupId>-->
44-
<!--<artifactId>jiguang-common</artifactId>-->
45-
<!--<version>1.1.6</version>-->
46-
<!--</dependency>-->
42+
<dependency>
43+
<groupId>cn.jpush.api</groupId>
44+
<artifactId>jiguang-common</artifactId>
45+
<version>1.1.7</version>
46+
</dependency>
4747
<dependency>
4848
<groupId>org.apache.httpcomponents</groupId>
4949
<artifactId>httpclient</artifactId>

src/main/java/cn/jpush/api/push/PushClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ private String getEncryptData(String payloadData) {
304304
* @return
305305
*/
306306
private String getEncryptData(PushPayload pushPayload) {
307-
if (_encryptType.isEmpty()) {
307+
if (StringUtils.isEmpty(_encryptType)) {
308308
return pushPayload.toString();
309309
}
310310
if (EncryptKeys.ENCRYPT_SMS2_TYPE.equals(_encryptType)) {
@@ -327,7 +327,7 @@ private String getEncryptData(PushPayload pushPayload) {
327327
* @return
328328
*/
329329
private String getEncryptData(String pushPayload, Audience audience) {
330-
if (_encryptType.isEmpty()) {
330+
if (StringUtils.isEmpty(_encryptType)) {
331331
return pushPayload;
332332
}
333333
if (EncryptKeys.ENCRYPT_SMS2_TYPE.equals(_encryptType)) {

src/main/java/cn/jpush/api/schedule/ScheduleClient.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package cn.jpush.api.schedule;
22

3+
import com.google.gson.annotations.Expose;
34
import org.slf4j.Logger;
45
import org.slf4j.LoggerFactory;
56

@@ -14,6 +15,8 @@
1415
import cn.jiguang.common.resp.ResponseWrapper;
1516
import cn.jpush.api.schedule.model.SchedulePayload;
1617

18+
import java.util.List;
19+
1720
public class ScheduleClient {
1821

1922
private static final Logger LOG = LoggerFactory.getLogger(ScheduleClient.class);

src/main/java/cn/jpush/api/schedule/ScheduleMsgIdsResult.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class ScheduleMsgIdsResult extends BaseResult{
1515

1616
@Expose int count;
1717

18-
@Expose List<JsonObject> msgids;
18+
@Expose List<String> msgids;
1919

2020
public int getCount() {
2121
return count;
@@ -25,11 +25,11 @@ public void setCount(int count) {
2525
this.count = count;
2626
}
2727

28-
public List<JsonObject> getMsgids() {
28+
public List<String> getMsgids() {
2929
return msgids;
3030
}
3131

32-
public void setMsgids(List<JsonObject> msgids) {
32+
public void setMsgids(List<String> msgids) {
3333
this.msgids = msgids;
3434
}
3535

0 commit comments

Comments
 (0)