From 771d6d13abc419ce5beb4287ca6a3b726f12a79f Mon Sep 17 00:00:00 2001 From: "Keith W. Boone" Date: Tue, 19 Nov 2024 22:56:00 -0500 Subject: [PATCH] NPE fix --- src/main/java/gov/cdc/izgateway/utils/HL7Utils.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/gov/cdc/izgateway/utils/HL7Utils.java b/src/main/java/gov/cdc/izgateway/utils/HL7Utils.java index 74a891f..4e012c0 100644 --- a/src/main/java/gov/cdc/izgateway/utils/HL7Utils.java +++ b/src/main/java/gov/cdc/izgateway/utils/HL7Utils.java @@ -247,6 +247,9 @@ public static String maskSegments(String message) { // Identify segment starts in text messages using the case sensitive pattern /[^a-zA-Z0-9][A-Z]{3}\|/ // (a non-alphanumeric character, followed by three uppercase alphabetic characters followed by a vertical bar |). // identify segment ends at either \r or \n or next segment start. + if (message == null) { + return null; + } Matcher m = HL7Utils.SEGMENT_STARTS.matcher(message); StringBuffer b = new StringBuffer(); for (boolean result = m.find(); result; result = m.find()) {