Skip to content

Commit

Permalink
fix: voteresult null data
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeongh00 committed Feb 4, 2024
1 parent f9071c6 commit 9119695
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ public LawVoteResult getVoteResult(LawVoteReq req) {
ObjectMapper objectMapper = new ObjectMapper();
try {
JsonNode rootNode = objectMapper.readTree(responseBody);
JsonNode dataArray = rootNode.get("nwbpacrgavhjryiph").get(1).get("row");
JsonNode resultCodeNodeOne = rootNode.path("RESULT").path("CODE");
JsonNode dataArray = null;

if (!resultCodeNodeOne.asText().equals("INFO-200")) {
dataArray = rootNode.get("nwbpacrgavhjryiph").get(1).get("row");
}

for (JsonNode dataNode : dataArray) {

Expand Down

0 comments on commit 9119695

Please sign in to comment.