Skip to content

Commit

Permalink
PI-2575 nullable field fixes (#4412)
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph-bcl authored Nov 8, 2024
1 parent 7dada9c commit 907bae0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ data class Defendant(

data class Offence(
val id: String,
val offenceDefinitionId: String,
val offenceDefinitionId: String? = null,
val offenceCode: String,
val offenceTitle: String,
val wording: String,
val offenceLegislation: String,
val listingNumber: Int,
val judicialResults: List<JudicialResult>,
val judicialResults: List<JudicialResult>? = emptyList(),
val plea: Plea? = null,
val verdict: Verdict? = null
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ class Handler(
.flatMap { it.defendants }
.filter { defendant ->
defendant.offences.any { offence ->
offence.judicialResults.any { judicialResult ->
offence.judicialResults?.any { judicialResult ->
judicialResult.isConvictedResult == true && judicialResult.label == "Remanded in custody"
}
} ?: false
}
}
if (defendants.isEmpty()) {
Expand Down

0 comments on commit 907bae0

Please sign in to comment.