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);