🐛 Object的equals方法容易抛空指针异常,应使用常量或确定有值的对象来调用equals。
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user