Fix bug
This commit is contained in:
@@ -196,6 +196,8 @@ public class TLWMatchesUpdaterFootball extends TLWMatchesManagerBase {
|
||||
|
||||
private void addPlaceholderMatches(ArrayList<TLWMatch> tlwMatches,
|
||||
JSONObject matchdayConfig) {
|
||||
Integer numberOfMatches = this.matchesPerMatchday;
|
||||
try { numberOfMatches = ((Long) matchdayConfig.get("numberOfMatches")).intValue();} catch (Exception ignored) {}
|
||||
ArrayList<TLWMatch> placeholderMatches = new ArrayList<>();
|
||||
ArrayList<TLWMatch> tlwMatchesCopy = new ArrayList<>(tlwMatches);
|
||||
JSONArray matchesConfig = (JSONArray) matchdayConfig.get("matchesConfig");
|
||||
@@ -224,7 +226,7 @@ public class TLWMatchesUpdaterFootball extends TLWMatchesManagerBase {
|
||||
}
|
||||
}
|
||||
// check if total number of matches is not too high
|
||||
if(tlwMatches.size() + placeholderMatches.size() > (Integer.parseInt(matchdayConfig.get("numberOfMatches").toString()))) {
|
||||
if(tlwMatches.size() + placeholderMatches.size() > (numberOfMatches)) {
|
||||
logger.error("Too many matches in config: " + this.season + ", " + this.league + ", " + tlwMatches.get(0).getMatchday());
|
||||
} else {
|
||||
// add placeholderMatches to tlwMatches
|
||||
|
||||
Reference in New Issue
Block a user