🐛 Object的equals方法容易抛空指针异常,应使用常量或确定有值的对象来调用equals。

This commit is contained in:
徐晓伟
2023-03-15 08:35:52 +08:00
parent 68d9148fa7
commit 270db3b53e
38 changed files with 129 additions and 129 deletions

View File

@@ -90,7 +90,7 @@ public class StoreProductController {
@RequestMapping(value = "/delete/{id}", method = RequestMethod.GET)
public CommonResult<String> delete(@RequestBody @PathVariable Integer id, @RequestParam(value = "type", required = false, defaultValue = "recycle")String type) {
if (storeProductService.deleteProduct(id, type)) {
if (type.equals("recycle")) {
if ("recycle".equals(type)) {
storeCartService.productStatusNotEnable(id);
} else {
storeCartService.productDelete(id);