axel3rd / mpg-coach-bot

MPG (Mon Petit Gazon) coach bot, to automate and optimize weekly actions
https://axel3rd.github.io/mpg-coach-bot/
MIT License
23 stars 8 forks source link

Crash on "Transactions proposal" and fix budget when some players proposition is existing #187

Closed axel3rd closed 3 years ago

axel3rd commented 3 years ago
Updating team ...

Transactions proposal ...
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.rangeCheck(ArrayList.java:657)
        at java.util.ArrayList.get(ArrayList.java:433)
        at org.blondin.mpg.Main.writeTransactionsProposal(Main.java:262)
        at org.blondin.mpg.Main.processGames(Main.java:208)
        at org.blondin.mpg.Main.processLeague(Main.java:115)
        at org.blondin.mpg.Main.process(Main.java:83)
        at org.blondin.mpg.Main.main(Main.java:68)
axel3rd commented 3 years ago

The root cause is when team has no Goalkeepers

axel3rd commented 3 years ago

In addition, the proposed budget should take into account the current proposals on some players.