From 35d6e22970ab5511eab5c4ff5254bac32f86449b Mon Sep 17 00:00:00 2001 From: Anthony Britton Date: Thu, 21 Mar 2024 14:55:59 +0000 Subject: [PATCH] Fix adding to mutable list --- .../uk/gov/justice/digital/hmpps/service/RiskService.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/assessment-summary-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/RiskService.kt b/projects/assessment-summary-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/RiskService.kt index bd017197e3..fd81999fef 100644 --- a/projects/assessment-summary-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/RiskService.kt +++ b/projects/assessment-summary-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/RiskService.kt @@ -47,7 +47,7 @@ class RiskService( return regEvent?.let { deRegEvents + it } ?: deRegEvents } - private fun createRegistration(person: Person, registrations: List, risk: Risk): HmppsDomainEvent { + private fun createRegistration(person: Person, registrations: MutableList, risk: Risk): HmppsDomainEvent { val type = registerTypeRepository.getByCode(risk.code) val nextReviewDate = type.reviewPeriod?.let { LocalDate.now().plusMonths(it) } val notes = listOfNotNull( @@ -82,7 +82,7 @@ class RiskService( nextReviewDate ).withReview(reviewContact) ) - registrations.addLast(registration) + registrations += registration return registration.regEvent(person.crn) } }