RLH-21 - Fix Sonar
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Bea 2024-11-11 16:25:48 +01:00
parent 7ffb02bbf0
commit 9b3f43937f

View File

@ -36,7 +36,7 @@ public class UserServiceImpl implements UserService
@Override @Override
public boolean deleteUser(UUID id) { public boolean deleteUser(UUID id) {
if (userRepository.findById(id).isEmpty()) { if (userRepository.findById(id).isEmpty()) {
throw new UsernameNotFoundException(id.toString()); throw new UsernameNotFoundException("User not found");
} }
if (userRepository.findById(id).isPresent()) { if (userRepository.findById(id).isPresent()) {
userRepository.delete(userRepository.findById(id).get()); userRepository.delete(userRepository.findById(id).get());