From 894d2ecc888762c7a34c957ee5088c826a89f775 Mon Sep 17 00:00:00 2001 From: "Mnushkin, Dmitry" Date: Fri, 20 Sep 2019 11:32:36 -0400 Subject: check for null before setting headers check for null before setting headers Issue-ID: SO-2356 Signed-off-by: Benjamin, Max (mb388a) Change-Id: I51bd332b13f687df09bc80489cf93baebc84ceb8 --- .../src/main/java/org/onap/so/client/dmaap/rest/DMaaPRestClient.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'common/src/main') diff --git a/common/src/main/java/org/onap/so/client/dmaap/rest/DMaaPRestClient.java b/common/src/main/java/org/onap/so/client/dmaap/rest/DMaaPRestClient.java index b0ffb9358c..e0c8d4ba80 100644 --- a/common/src/main/java/org/onap/so/client/dmaap/rest/DMaaPRestClient.java +++ b/common/src/main/java/org/onap/so/client/dmaap/rest/DMaaPRestClient.java @@ -52,6 +52,8 @@ public class DMaaPRestClient extends RestClient { } String onapRequestId = UUID.randomUUID().toString(); headerMap.put(ONAPLogConstants.Headers.REQUEST_ID, onapRequestId); - headerMap.put(ONAPLogConstants.Headers.INVOCATION_ID, MDC.get(ONAPLogConstants.MDCs.REQUEST_ID)); + if (MDC.get(ONAPLogConstants.MDCs.REQUEST_ID) != null) { + headerMap.put(ONAPLogConstants.Headers.INVOCATION_ID, MDC.get(ONAPLogConstants.MDCs.REQUEST_ID)); + } } } -- cgit 1.2.3-korg