NCBACK-25 fix check duplicate exception
Test Workflow / test (push) Successful in 3s

This commit is contained in:
vladp
2026-01-25 19:59:16 +07:00
parent 69a79b7ac7
commit 76103b9d96
2 changed files with 17 additions and 5 deletions
@@ -382,7 +382,7 @@ public class FileUploadServiceImpl implements FileUploadService {
}
private void checkForDuplicatesSynchronously(String filePath)
throws IOException {
throws IOException , DuplicateImageException {
Path path = Paths.get(filePath);
Map<String, Long> hash = imageHashService.calculateHash(path);
@@ -390,8 +390,8 @@ public class FileUploadServiceImpl implements FileUploadService {
hash.get("hi"), hash.get("low"));
if (!duplicates.isEmpty()) {
throw new DuplicateImageException("Duplicate", duplicates.get(0).getId(),
duplicates.get(0).getUserId());
throw new DuplicateImageException("Duplicate", duplicates.getFirst().getId(),
duplicates.getFirst().getUserId());
}
}