#vulnerable code 
                                @Override
    public Result<Integer> save(RcRole role, List<Integer> permissionIds) {
        Result<Integer> result=new Result<>();
        result.setStatus(false);
        result.setCode(MsgCode.FAILED);
        if (selectByRoleName(role.getName()) != null){
            result.setMsg("角色名已存在");
            return result;
        }
        if (selectByRoleValue(role.getValue()) != null){
            result.setMsg("角色值已存在");
            return result;
        }
        roleMapper.insert(role);
        role = selectByRoleName(role.getName());
        result = relationService.save(role.getId(),permissionIds);
        return result;
    } 
                            #location 16 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                @Override
    public Result<Integer> save(RcRole role, List<Integer> permissionIds) {
        Result<Integer> result=new Result<>();
        result.setStatus(false);
        result.setCode(MsgCode.FAILED);
        if (selectByRoleName(role.getName()) != null){
            result.setMsg("角色名已存在");
            return result;
        }
        if (selectByRoleValue(role.getValue()) != null){
            result.setMsg("角色值已存在");
            return result;
        }
        roleMapper.insert(role);
        role = selectByRoleName(role.getName());
        return result;
    }