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

Merge pull request !21 from 徐晓伟/master-equals
This commit is contained in:
大粽子
2023-06-15 03:19:42 +00:00
committed by Gitee
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);