xiewenjie 4 years ago
parent
commit
cd5aaefc34

+ 5 - 3
sxz-core/src/main/java/com/fdkk/sxz/webApi/controller/custom/CustomManagerController.java

@@ -400,9 +400,11 @@ public class CustomManagerController extends BaseController {
             ResponseCustomProductManager manager = new ResponseCustomProductManager();
             BeanUtil.copyProperties(customProductEntity, manager, false);
             CustomProductFirstclassifyEntity firstclassifyEntity = productFirstclassifyService.findById(customProductEntity.getParentId());
-            manager.setModelId(customProductEntity.getModelId());
-            manager.setTypeName(firstclassifyEntity.getName());
-            managers.add(manager);
+            if (ObjectUtil.isNotNull(firstclassifyEntity)){
+                manager.setModelId(customProductEntity.getModelId());
+                manager.setTypeName(firstclassifyEntity.getName());
+                managers.add(manager);
+            }
         }
 
         Page<ResponseCustomProductManager> a = new Page<>(param.getPageNum(), param.getPageSize());