Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Commit

Permalink
Fix for NPE when header values are null (#2964)
Browse files Browse the repository at this point in the history
* Fix for NPE when header values are null

* fixed formatting

Co-authored-by: mhubli <Muralidhar.Hubli@wolterskluwer.com>
  • Loading branch information
muralicmr and mhubli authored May 4, 2022
1 parent 7f8a6b0 commit 4e1f08a
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,12 @@ protected HttpResponse httpCall(Input input) throws Exception {
headers.setContentType(MediaType.valueOf(input.getContentType()));
headers.setAccept(Collections.singletonList(MediaType.valueOf(input.getAccept())));

input.headers.forEach((key, value) -> headers.add(key, value.toString()));
input.headers.forEach(
(key, value) -> {
if (value != null) {
headers.add(key, value.toString());
}
});

HttpEntity<Object> request = new HttpEntity<>(input.getBody(), headers);

Expand Down

0 comments on commit 4e1f08a

Please sign in to comment.