diff --git a/projects/assessment-summary-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/oasys/OrdsClient.kt b/projects/assessment-summary-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/oasys/OrdsClient.kt index c9bee0c7cc..ada0260b2a 100644 --- a/projects/assessment-summary-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/oasys/OrdsClient.kt +++ b/projects/assessment-summary-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/oasys/OrdsClient.kt @@ -42,7 +42,7 @@ data class AssessmentSummary( val weightedScores: WeightedScores = WeightedScores(), val furtherInformation: FurtherInformation = FurtherInformation(), val ogpOvp: OgpOvp = OgpOvp(), - val offences: List = arrayListOf(), + val offences: List? = arrayListOf(), val basicSentencePlan: List? = null, val sentencePlan: SentencePlan? = null ) { diff --git a/projects/assessment-summary-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/AssessmentService.kt b/projects/assessment-summary-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/AssessmentService.kt index e56be52c25..63548ded9d 100644 --- a/projects/assessment-summary-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/AssessmentService.kt +++ b/projects/assessment-summary-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/AssessmentService.kt @@ -61,7 +61,8 @@ class AssessmentService( contact = contact, court = furtherInformation.courtCode ?.let { courtRepository.getByCode(it) }, - offence = offences.firstOrNull { it.offenceCode != null && it.offenceSubcode != null } + offence = offences + ?.firstOrNull { it.offenceCode != null && it.offenceSubcode != null } ?.let { offenceRepository.findByCode(it.offenceCode + it.offenceSubcode) }, totalScore = furtherInformation.totWeightedScore, description = furtherInformation.pOAssessmentDesc,