Skip to content

Commit

Permalink
Prevent null elements on existing providers list
Browse files Browse the repository at this point in the history
  • Loading branch information
icrc-psousa committed Jun 26, 2024
1 parent 66b7d01 commit a58039a
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -128,6 +129,7 @@ public org.openmrs.Encounter toOpenmrsType(@Nonnull org.openmrs.Encounter existi
existingProviders.addAll(encounter
.getParticipant().stream().map(encounterParticipantComponent -> participantTranslator
.toOpenmrsType(new EncounterProvider(), encounterParticipantComponent))
.filter(Objects::nonNull)
.collect(Collectors.toCollection(LinkedHashSet::new)));

for (EncounterProvider ep : existingEncounter.getEncounterProviders()) {
Expand Down

0 comments on commit a58039a

Please sign in to comment.