[FIX] Profile duplicate

This commit is contained in:
Gravita 2024-07-30 15:43:22 +07:00
parent e6f5b585a7
commit 1e7a856a99
No known key found for this signature in database
GPG key ID: 543A8F335C9CD633

View file

@ -45,8 +45,7 @@ public void addProfile(ClientProfile profile) throws IOException {
} }
} }
if(target == null) { if(target == null) {
target = IOHelper.resolveIncremental(profilesDirPath, target = profilesDirPath.resolve(profile.getTitle()+".json");
profile.getTitle(), "json");
oldProfile = profilesMap.get(target); oldProfile = profilesMap.get(target);
if(oldProfile != null && !oldProfile.getUUID().equals(profile.getUUID())) { if(oldProfile != null && !oldProfile.getUUID().equals(profile.getUUID())) {
throw new FileAlreadyExistsException(target.toString()); throw new FileAlreadyExistsException(target.toString());