if (name.isEmpty()) {
throw new BadRequestException("name cannot be empty");
}
if (!name.equals(profile.getName())) {
Session session = sessionFactory.getCurrentSession();
<BUG>GameProfile conflictProfile = (GameProfile) session.createCriteria(GameProfile.class).add(eq("name", name)).uniqueResult();
</BUG>
if (conflictProfile != null) {
throw new ConflictException("name conflict with profile " + conflictProfile.getUuid());
}

if (name.isEmpty()) {
throw new BadRequestException("name cannot be empty");
}
if (!name.equals(profile.getName())) {
Session session = sessionFactory.getCurrentSession();
GameProfile conflictProfile = (GameProfile) session.createCriteria(GameProfile.class).add(eq("name", name)).setCacheable(true).uniqueResult();
if (conflictProfile != null) {
throw new ConflictException("name conflict with profile " + conflictProfile.getUuid());
}
