Commit d262c1a3c444b0434b45fc584e17a06d82172e73

Authored by litao
1 parent c0dd84aa5c

bug修复

Showing 1 changed file with 8 additions and 8 deletions

platform-common/src/main/java/com/lyms/platform/common/result/RespBuilder.java View file @ d262c1a
... ... @@ -17,16 +17,16 @@
17 17 }
18 18  
19 19 public static BaseObjectResponse buildSuccess(Object ... data) {
20   - Assert.notNull(data);
21   - Assert.isTrue(data.length == 1 || data.length % 2 == 0, "length必须为偶数");
22   -
23 20 BaseObjectResponse resp = new BaseObjectResponse();
24   - if(data.length == 1) {
25   - resp.setData(data);
26   - } else {
27   - resp.setData(createMap(data));
28   - }
  21 + if(data != null) {
  22 + Assert.isTrue(data.length == 1 || data.length % 2 == 0, "length必须为偶数");
29 23  
  24 + if(data.length == 1) {
  25 + resp.setData(data);
  26 + } else {
  27 + resp.setData(createMap(data));
  28 + }
  29 + }
30 30 return resp;
31 31 }
32 32