Springboot
Victor SOULIER 1 year ago
parent fd260b863d
commit 5b8a412a0d

@ -33,7 +33,7 @@ public class IndiceService implements IIndiceService {
@Override
public Indice create(Indice indice){
if(this.indiceRepository.existsById(indice.getId())){
if(indice.getId() != null && this.indiceRepository.existsById(indice.getId())){
throw new DuplicatedIdException();
}
return this.indiceRepository.save(indice);

Loading…
Cancel
Save