db/simple: reorder checks in assert() to fix assertion failure

`light_song.Get()` could cause an assertion failure because the
`Manual<>` object must not be used if uninitialized.

Regression by commit ebc006ab52
This commit is contained in:
Max Kellermann 2019-02-20 21:24:01 +01:00
parent cc28a7b67f
commit cf2d171ccc
2 changed files with 3 additions and 1 deletions

2
NEWS
View File

@ -2,6 +2,8 @@ ver 0.21.5 (not yet released)
* protocol
- fix deadlock in "albumart" command
- fix "tagtypes disable" command
* database
- simple: fix assertion failure
* input
- buffer: fix crash bug when playing remote WAV file
* tags

View File

@ -251,7 +251,7 @@ void
SimpleDatabase::ReturnSong(gcc_unused const LightSong *song) const noexcept
{
assert(song != nullptr);
assert(song == &light_song.Get() || song == prefixed_light_song);
assert(song == prefixed_light_song || song == &light_song.Get());
if (prefixed_light_song != nullptr) {
delete prefixed_light_song;