Skip to content

Commit 2003f0e

Browse files
authored
Update PokeApiClass.java
1 parent 665399f commit 2003f0e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/main/java/com/ngcodex/PokeApiClass.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public static void main(String[] args) {
1515
try {
1616
HttpResponse<String> listResponse = client.send(listRequest, HttpResponse.BodyHandlers.ofString());
1717
Map<String, Object> listResponseMap = JsonClass.parseJsonObject(listResponse.body());
18-
if (listResponseMap.containsKey("results")) {
18+
1919
List<Map<String, Object>> pokemonList = (List<Map<String, Object>>) listResponseMap.get("results");
2020
if (!pokemonList.isEmpty()) {
2121
Map<String, Object> firstPokemon = pokemonList.get(0);
@@ -68,4 +68,4 @@ public static void main(String[] args) {
6868
e.printStackTrace();
6969
}
7070
}
71-
}
71+
}

0 commit comments

Comments
 (0)