Merge pull request #24 from gmbrax/fix/fix-broken-album-method
Fix broken removeGenre implementation in Album entity
This commit is contained in:
commit
61c5124d27
|
|
@ -98,9 +98,14 @@ public class Album {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeGenre(Genre genre) {
|
public void removeGenre(Genre genre) {
|
||||||
|
if (genre == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
albumGenres.removeIf(ag ->
|
||||||
ag.getGenre() != null &&
|
ag.getGenre() != null &&
|
||||||
ag.getGenre().getId() != null &&
|
ag.getGenre().getId() != null &&
|
||||||
ag.getGenre().getId().equals(genre.getId())
|
ag.getGenre().getId().equals(genre.getId())
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Método conveniente para pegar só os gêneros
|
// Método conveniente para pegar só os gêneros
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue