java.lang.IllegalArgumentException: Source must not be null

    ProductManagementAppEntity entity = Mapper.selectOne(
            new QueryWrapper<Entity>().eq("id", id));
    Resp resp=new Resp();
    if (entity != null){
        BeanUtil.copyProperties(entity,resp);
    }
    return ResponseUtil.ok(resp);

The reason for my error is that no data was found in the query database, the return value was empty, and an exception occurred when using the tool to convert. If it is a self-encapsulated class conversion tool class, remember to add the empty judgment.
 

Guess you like

Origin blog.csdn.net/wufaqidong1/article/details/130134903