We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2bb9047 commit a86bb1bCopy full SHA for a86bb1b
src/main/java/pw/chew/mlb/util/AutocompleteUtil.java
@@ -155,7 +155,14 @@ public static List<Command.Choice> getTodayGames(boolean showFinal) {
155
// Build games
156
List<Command.Choice> choices = new ArrayList<>();
157
158
- JSONArray games = gameResponse.getJSONArray("dates").getJSONObject(0).getJSONArray("games");
+ JSONArray dates = gameResponse.getJSONArray("dates");
159
+
160
+ // No games today
161
+ if (dates.isEmpty()) {
162
+ return choices;
163
+ }
164
165
+ JSONArray games = dates.getJSONObject(0).getJSONArray("games");
166
167
for (int i = 0; i < games.length(); i++) {
168
JSONObject game = games.getJSONObject(i);
0 commit comments