!89 修复Cannot invoke "org.ssssssss.magicapi.core.model.MagicEntity.getId()" because "entity" is null 异常

Merge pull request !89 from elsfs/dev
This commit is contained in:
小东
2025-04-30 06:39:37 +00:00
committed by Gitee

View File

@@ -83,6 +83,9 @@ public class MagicResourceController extends MagicController implements MagicExc
.read(bytes);
isTrue(allowVisit(request, Authorization.SAVE, entity), PERMISSION_INVALID);
// 自动保存的代码,和旧版代码对比,如果一致,则不保存,直接返回。
if (entity ==null){
return new JsonBean<>(null);
}
if(entity.getId() != null && "1".equals(auto)){
MagicEntity oldInfo = service.file(entity.getId());
if(oldInfo != null && Objects.equals(oldInfo, entity)){