Commit 5041d62052e7d58b3eb1c65925344f4c09f10e9f
1 parent
dcc6aa0c
fix: 修改搜索判断
Showing
1 changed file
with
7 additions
and
4 deletions
shop/src/main/java/com/canrd/shop/service/impl/ProductServiceImpl.java
... | ... | @@ -432,10 +432,13 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, ProductDO> im |
432 | 432 | } |
433 | 433 | } |
434 | 434 | //将productDO的productimageliststore解析为map |
435 | - List<Map> maps = JSON.parseArray(product.getProductimageliststore(), Map.class); | |
436 | - Map map = maps.get(0); | |
437 | - product.setImageFileKey(map.get("fileKey").toString()); | |
438 | - | |
435 | + if (product.getProductimageliststore() != null) { | |
436 | + List<Map> maps = JSON.parseArray(product.getProductimageliststore(), Map.class); | |
437 | + if (CollUtil.isNotEmpty(maps)) { | |
438 | + Map map = maps.get(0); | |
439 | + product.setImageFileKey(map.get("fileKey").toString()); | |
440 | + } | |
441 | + } | |
439 | 442 | }); |
440 | 443 | } |
441 | 444 | ... | ... |