浏览代码

fix[litemall-wx-api]: 检查是否空

Junling Bu 6 年之前
父节点
当前提交
f4213410b6

+ 3 - 0
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCatalogController.java

@@ -119,6 +119,9 @@ public class WxCatalogController {
     public Object current(@NotNull Integer id) {
         // 当前分类
         LitemallCategory currentCategory = categoryService.findById(id);
+        if(currentCategory == null){
+            return ResponseUtil.badArgumentValue();
+        }
         List<LitemallCategory> currentSubCategory = categoryService.queryByPid(currentCategory.getId());
 
         Map<String, Object> data = new HashMap<String, Object>();