From b626f5867bbd2bfbfd15598675ce64b4823f1b79 Mon Sep 17 00:00:00 2001 From: patrick-werner Date: Sun, 1 Mar 2020 22:51:57 +0100 Subject: [PATCH] always check for contained key --- .../java/org/hl7/fhir/validation/BaseValidator.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/BaseValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/BaseValidator.java index e24153be8..c95e1f364 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/BaseValidator.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/BaseValidator.java @@ -145,11 +145,13 @@ public class BaseValidator { protected String formatMessage(String theMessage, Object... theMessageArguments) { - String message; - if (theMessageArguments != null && theMessageArguments.length > 0) { - message = MessageFormat.format(messages.getString(theMessage), theMessageArguments); - } else if (messages.containsKey(theMessage)) { - message = messages.getString(theMessage); + String message = ""; + if (messages.containsKey(theMessage)) { + if (theMessageArguments != null && theMessageArguments.length > 0) { + message = MessageFormat.format(messages.getString(theMessage), theMessageArguments); + } else if (messages.containsKey(theMessage)) { + message = messages.getString(theMessage); + } } else { message = theMessage; }