json 解析异常捕获
This commit is contained in:
parent
52cb628bf2
commit
6893425ac4
|
|
@ -162,8 +162,13 @@ public class ShopActivateServiceImpl extends ServiceImpl<ShopActivateMapper, Sho
|
|||
* 获取优惠券详细信息 目前仅返回 id 名称 剩余数量 赠送数量
|
||||
*/
|
||||
private List<ShopCoupon> getCoupons(String couponJson) {
|
||||
Map<String, Integer> couponMap = JSONObject.parseObject(couponJson, new TypeReference<>() {
|
||||
});
|
||||
Map<String, Integer> couponMap;
|
||||
try {
|
||||
couponMap = JSONObject.parseObject(couponJson, new TypeReference<>() {});
|
||||
} catch (Exception e) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
if (couponMap.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue