From 0cd9419ed2ec7176f7e1705a709a7c85eb0b0fd0 Mon Sep 17 00:00:00 2001 From: preetamnpr <128618622+preetamnpr@users.noreply.github.com> Date: Tue, 26 Nov 2024 09:12:38 +0100 Subject: [PATCH] SD-587 added extra conditions to handle the MissingNode. --- .../standards/booking/model/PersistableCarrierBooking.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/booking/src/main/java/org/dcsa/conformance/standards/booking/model/PersistableCarrierBooking.java b/booking/src/main/java/org/dcsa/conformance/standards/booking/model/PersistableCarrierBooking.java index c1b8f27f..fcf186ff 100644 --- a/booking/src/main/java/org/dcsa/conformance/standards/booking/model/PersistableCarrierBooking.java +++ b/booking/src/main/java/org/dcsa/conformance/standards/booking/model/PersistableCarrierBooking.java @@ -390,7 +390,7 @@ public JsonNode asPersistentState() { public static PersistableCarrierBooking fromPersistentStore(JsonNodeMap jsonNodeMap, String carrierBookingRequestReference) { var data = jsonNodeMap.load(carrierBookingRequestReference); - if (data == null) { + if (data == null || data.isMissingNode() || !data.isObject()) { throw new IllegalArgumentException("Unknown CBRR: " + carrierBookingRequestReference); } return fromPersistentStore(data);