Skip to content

Commit 513edab

Browse files
Review comment fixes
1 parent 3157fc2 commit 513edab

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

sormas-api/src/main/java/de/symeda/sormas/api/environment/EnvironmentDto.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -266,13 +266,13 @@ public void setVectorType(VectorType vectorType) {
266266
}
267267

268268
public void addEventReference(EventReferenceDto eventReferenceDto) {
269-
if (eventReferenceDto != null) {
270-
if (!eventReferenceDtos.contains(eventReferenceDto)) {
271-
this.eventReferenceDtos.add(eventReferenceDto);
272-
}
273-
} else {
274-
throw new IllegalArgumentException("eventReferenceDto is " + eventReferenceDto);
269+
if (eventReferenceDto == null) {
270+
throw new IllegalArgumentException("eventReferenceDto must not be null");
275271
}
272+
if (eventReferenceDtos.contains(eventReferenceDto)) {
273+
throw new IllegalArgumentException("eventReference " + eventReferenceDto.getUuid() + " already exists.");
274+
}
275+
this.eventReferenceDtos.add(eventReferenceDto);
276276
}
277277

278278
public List<EventReferenceDto> getEventReferenceDtos() {

0 commit comments

Comments
 (0)