From 9f431329f7e66a832959a3bde6cc8eaa659b2754 Mon Sep 17 00:00:00 2001 From: Marcus Aspin Date: Tue, 19 Nov 2024 16:34:52 +0000 Subject: [PATCH] PI-2625 Handle null location change date --- .../uk/gov/justice/digital/hmpps/messaging/PrisonerMovement.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/prison-custody-status-to-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/messaging/PrisonerMovement.kt b/projects/prison-custody-status-to-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/messaging/PrisonerMovement.kt index 0c28ebfcb..2e610986d 100644 --- a/projects/prison-custody-status-to-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/messaging/PrisonerMovement.kt +++ b/projects/prison-custody-status-to-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/messaging/PrisonerMovement.kt @@ -79,4 +79,4 @@ fun PrisonerMovement.statusDateValid(custody: Custody): Boolean = occurredAt <= ZonedDateTime.now() && occurredAt.toLocalDate() >= custody.statusChangeDate fun PrisonerMovement.locationDateValid(custody: Custody): Boolean = - occurredAt <= ZonedDateTime.now() && occurredAt.toLocalDate() >= custody.locationChangeDate + occurredAt <= ZonedDateTime.now() && (custody.locationChangeDate == null || occurredAt.toLocalDate() >= custody.locationChangeDate)