Fix broken removeGenre implementation in Album entity

This commit is contained in:
Gustavo Henrique Santos Souza de Miranda 2025-12-08 00:22:42 -03:00
parent d70fae0719
commit bcd03fc7ce
1 changed files with 5 additions and 3 deletions

View File

@ -98,9 +98,11 @@ public class Album {
}
public void removeGenre(Genre genre) {
albumGenres.removeIf(ag ->
ag.getGenre() != null &&
ag.getGenre().getId() != null &&
ag.getGenre().getId().equals(genre.getId())
);
}
// Método conveniente para pegar os gêneros