Browse Source

处理空指针

master
xyiege 3 years ago
parent
commit
1c2a5a2788
  1. 8
      src/main/java/cn/chjyj/szwh/utils/SzCarUtils.java

8
src/main/java/cn/chjyj/szwh/utils/SzCarUtils.java

@ -24,11 +24,11 @@ public class SzCarUtils {
if(shopCar!=null) { if(shopCar!=null) {
JSONObject shopCarJson = JSONObject.parseObject(shopCar.toString()); JSONObject shopCarJson = JSONObject.parseObject(shopCar.toString());
JSONArray jsonArray = shopCarJson.getJSONArray("data"); JSONArray jsonArray = shopCarJson.getJSONArray("data");
for(int x=0;x<jsonArray.size();x++){ if(jsonArray!=null) {
carItem.add(jsonArray.getJSONObject(x)); for (int x = 0; x < jsonArray.size(); x++) {
carItem.add(jsonArray.getJSONObject(x));
}
} }
// 在jsonArray中集训增加
//jsonArray.add(new JSONObject(ugmap));
}else{ }else{
carItem.add(new JSONObject(ugmap)); carItem.add(new JSONObject(ugmap));
} }

Loading…
Cancel
Save