npe
This commit is contained in:
parent
18e27f3038
commit
8b295bcbcb
|
@ -241,7 +241,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
public void updateVisits(Long id) {
|
||||
ResourceEntity resourceEntity = resourceDao.selectById(id);
|
||||
ResourceEntity entity = new ResourceEntity();
|
||||
entity.setVisits(resourceEntity.getVisits() + 1);
|
||||
entity.setVisits((resourceEntity.getVisits() == null ? 0 : resourceEntity.getVisits()) + 1);
|
||||
UpdateWrapper<ResourceEntity> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.lambda()
|
||||
.eq(ResourceEntity::getId, resourceEntity.getId())
|
||||
|
|
Loading…
Reference in New Issue