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

fix: added null checks to remove home/away games

parent f8c481c0
No related branches found
No related tags found
No related merge requests found
...@@ -71,12 +71,18 @@ public class TeamServiceImpl implements TeamService { ...@@ -71,12 +71,18 @@ public class TeamServiceImpl implements TeamService {
@Override @Override
public void removeHomeGame(Team homeTeam, Game game) { public void removeHomeGame(Team homeTeam, Game game) {
if (game == null) {
throw new NullPointerException("The game is null");
}
homeTeam.removeHomeGame(game); homeTeam.removeHomeGame(game);
teamDao.update(homeTeam); teamDao.update(homeTeam);
} }
@Override @Override
public void removeAwayGame(Team awayTeam, Game game) { public void removeAwayGame(Team awayTeam, Game game) {
if (game == null) {
throw new NullPointerException("The game is null");
}
awayTeam.removeAwayGame(game); awayTeam.removeAwayGame(game);
teamDao.update(awayTeam); teamDao.update(awayTeam);
} }
......
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