Skip to content
Snippets Groups Projects
Commit 4f814b88 authored by Erik Moravec's avatar Erik Moravec
Browse files

Fix: added null checks to add home/away games

parent 32ee4445
No related branches found
No related tags found
No related merge requests found
......@@ -53,15 +53,20 @@ public class TeamServiceImpl implements TeamService {
@Override
public void addHomeGame(Team homeTeam, Game game) {
if (game == null) {
throw new NullPointerException("The game is null");
}
homeTeam.addHomeGame(game);
teamDao.update(homeTeam);
}
@Override
public void addAwayGame(Team awayTeam, Game game) {
if (game == null) {
throw new NullPointerException("The game is null");
}
awayTeam.addAwayGame(game);
teamDao.update(awayTeam);
}
@Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment