Commit cf2d171c authored by Max Kellermann's avatar Max Kellermann

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 ebc006ab
parent cc28a7b6
...@@ -2,6 +2,8 @@ ver 0.21.5 (not yet released) ...@@ -2,6 +2,8 @@ ver 0.21.5 (not yet released)
* protocol * protocol
- fix deadlock in "albumart" command - fix deadlock in "albumart" command
- fix "tagtypes disable" command - fix "tagtypes disable" command
* database
- simple: fix assertion failure
* input * input
- buffer: fix crash bug when playing remote WAV file - buffer: fix crash bug when playing remote WAV file
* tags * tags
......
...@@ -251,7 +251,7 @@ void ...@@ -251,7 +251,7 @@ void
SimpleDatabase::ReturnSong(gcc_unused const LightSong *song) const noexcept SimpleDatabase::ReturnSong(gcc_unused const LightSong *song) const noexcept
{ {
assert(song != nullptr); 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) { if (prefixed_light_song != nullptr) {
delete prefixed_light_song; delete prefixed_light_song;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment