Skip to content

Commit

Permalink
Handle a null response object.
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanLCox1 committed Aug 26, 2024
1 parent 0854a20 commit 2873e79
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/com/smartystreets/api/us_street/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ public void send(Batch batch) throws SmartyException, IOException, InterruptedEx

Response response = this.sender.send(request);

Candidate[] candidates = this.serializer.deserialize(response.getPayload(), Candidate[].class);
Candidate[] candidates = null;

if (response != null) {
candidates = this.serializer.deserialize(response.getPayload(), Candidate[].class);
}

if (candidates == null)
candidates = new Candidate[0];
this.assignCandidatesToLookups(batch, candidates);
Expand Down

0 comments on commit 2873e79

Please sign in to comment.