Skip to content

Commit

Permalink
Adding a null check to the whole AddressDoctor response object. HTTP …
Browse files Browse the repository at this point in the history
…errors cause this object to not be filled, thus leading to a null pointer exception
  • Loading branch information
JoshuaBurtonCGI committed Nov 21, 2024
1 parent 6a48da9 commit aee33cb
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ private AddressDoctorResults processAddressDoctorResults(SOAPEnvelopeOutput addr

AddressDoctorResults addressDoctorResults = new AddressDoctorResults();

if (addressDoctorResponse == null) {
addError(processData, "ValidationError", "ERROR", "Could not reach or get a response from the AddressDoctor service");
addressDoctorResults.setError(true);
return addressDoctorResults;
}

SOAPBodyOutput soapBody = addressDoctorResponse.getSoapBody();
if (soapBody == null) {
logger.error("The SOAP Body message is missing due to a possible PHLAT misconfiguration or an issue with AddressDoctor");
Expand Down

0 comments on commit aee33cb

Please sign in to comment.