File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
sormas-api/src/main/java/de/symeda/sormas/api/environment Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff 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 () {
You can’t perform that action at this time.
0 commit comments