Skip to content

Commit

Permalink
Fix adding to mutable list
Browse files Browse the repository at this point in the history
  • Loading branch information
anthony-britton-moj committed Mar 21, 2024
1 parent 7e53e95 commit 35d6e22
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class RiskService(
return regEvent?.let { deRegEvents + it } ?: deRegEvents
}

private fun createRegistration(person: Person, registrations: List<Registration>, risk: Risk): HmppsDomainEvent {
private fun createRegistration(person: Person, registrations: MutableList<Registration>, risk: Risk): HmppsDomainEvent {
val type = registerTypeRepository.getByCode(risk.code)
val nextReviewDate = type.reviewPeriod?.let { LocalDate.now().plusMonths(it) }
val notes = listOfNotNull(
Expand Down Expand Up @@ -82,7 +82,7 @@ class RiskService(
nextReviewDate
).withReview(reviewContact)
)
registrations.addLast(registration)
registrations += registration
return registration.regEvent(person.crn)
}
}
Expand Down

0 comments on commit 35d6e22

Please sign in to comment.