Skip to content

Commit

Permalink
Update PokeApiClass.java
Browse files Browse the repository at this point in the history
  • Loading branch information
codeurzebs committed Dec 8, 2023
1 parent 665399f commit 2003f0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/ngcodex/PokeApiClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static void main(String[] args) {
try {
HttpResponse<String> listResponse = client.send(listRequest, HttpResponse.BodyHandlers.ofString());
Map<String, Object> listResponseMap = JsonClass.parseJsonObject(listResponse.body());
if (listResponseMap.containsKey("results")) {

List<Map<String, Object>> pokemonList = (List<Map<String, Object>>) listResponseMap.get("results");
if (!pokemonList.isEmpty()) {
Map<String, Object> firstPokemon = pokemonList.get(0);
Expand Down Expand Up @@ -68,4 +68,4 @@ public static void main(String[] args) {
e.printStackTrace();
}
}
}
}

0 comments on commit 2003f0e

Please sign in to comment.