diff --git a/src/main/java/de/jeyp91/tippliga/TLWMatchesUpdaterFootball.java b/src/main/java/de/jeyp91/tippliga/TLWMatchesUpdaterFootball.java index 88ad6b6..6fc06e9 100644 --- a/src/main/java/de/jeyp91/tippliga/TLWMatchesUpdaterFootball.java +++ b/src/main/java/de/jeyp91/tippliga/TLWMatchesUpdaterFootball.java @@ -160,7 +160,7 @@ public class TLWMatchesUpdaterFootball extends TLWMatchesManagerBase { } } if(!done) { - logger.error("Could not add missing match"); + logger.error("Could not add missing match: " + this.season + ", " + this.league + ", " + tlwMatches.get(0).getMatchday() + ", " + missingMatch.getTeamNameHome() + " - " + missingMatch.getTeamNameGuest()); } } } @@ -173,7 +173,7 @@ public class TLWMatchesUpdaterFootball extends TLWMatchesManagerBase { TLWMatch tlwMatch = getMatchingMatch(apiFootballMatch, tlwMatches); if(tlwMatch == null) { StatusHolder.setError(); - logger.error("Did not find match to update"); + logger.error("Did not find match to update: " + this.season + ", " + this.league + ", " + tlwMatches.get(0).getMatchday() + ", " + apiFootballMatch.getTeamNameHome() + " - " + apiFootballMatch.getTeamNameGuest()); } tlwMatch.setMatchDateTime(apiFootballMatch.getMatchDateTime().replace("T", " ").substring(0, 19)); } @@ -210,13 +210,16 @@ public class TLWMatchesUpdaterFootball extends TLWMatchesManagerBase { for(TLWMatch match : tlwMatches) { Integer apiTeamIdHome = TeamIDMatcher.getTippligaIdFromApiFootballId(apiFootballMatch, TeamIDMatcher.HOME); Integer apiTeamIdGuest = TeamIDMatcher.getTippligaIdFromApiFootballId(apiFootballMatch, TeamIDMatcher.GUEST); + int tlwTeamIdHome = match.getTeamIdHome(); + int tlwTeamIdGuest = match.getTeamIdGuest(); + if(apiTeamIdHome == null || apiTeamIdGuest == null) { throw new NullPointerException(); } if( - apiTeamIdHome == match.getTeamIdHome() - && apiTeamIdGuest == match.getTeamIdGuest() + apiTeamIdHome.equals(tlwTeamIdHome) + && apiTeamIdGuest.equals(tlwTeamIdGuest) ) { foundMatches++; matchingMatch = match;