Skip to content

Commit 1b98d8d

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

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
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-
18+
if (listResponseMap.containsKey("results")) {
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);

0 commit comments

Comments
 (0)