handle no json error

This commit is contained in:
Joseph Garcia 2021-01-28 09:17:18 -06:00
parent b9a5edab1a
commit 8565d6e5ea

View File

@ -74,14 +74,11 @@ public class ConfigFile {
for (int i = 0; i < array.size(); i++) { for (int i = 0; i < array.size(); i++) {
JSONObject childObject = (JSONObject)array.get(i); JSONObject childObject = (JSONObject)array.get(i);
commandObjects.add(childObject); commandObjects.add(childObject);
System.out.println(i);
if (i >= 19) break; if (i >= 19) break;
} }
return commandObjects; return commandObjects;
} catch (IOException e) { } catch (IOException | ParseException e) {
e.printStackTrace(); System.out.println("Commands.json not yet initialized!");
} catch (ParseException e) {
e.printStackTrace();
} }
return null; return null;
} }