通过id查找数据库某表时,运行后postman上显示Index 0 out of bounds for length 0

img
这是postman上的运行结果

    public OrderGroupDto selectOrderGroupById(String id) throws ScExtException {
        List<OrderGroupEntity> orderGroupEntityList = new ArrayList<>();
        OrderGroupEntity orderEntity = orderGroupMapper.selectByPrimaryKey(id);
        if (orderEntity == null){
            throw new ScExtException("该订单组不存在");
        }
        orderGroupEntityList.add(orderEntity);
        return orderGroupEntity2OrderGroupDto(orderGroupEntityList).get(0);
    }

上面是这个接口的service层,想使用selectByPrimaryKey的方法,但结果总是Index 0 out of bounds for length 0,求解

本身数据库数据就没有吧

看看 orderGroupEntity2OrderGroupDto 方法里面做了什么