diff options
author | Max Kellermann <max@duempel.org> | 2014-09-18 17:22:31 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-09-18 17:22:31 +0200 |
commit | eeb8d0dbcdc213a430ce00057da061a86804fc7b (patch) | |
tree | b845c35856c9b5752e306a9b64c27a6aab7a1686 /src/db | |
parent | 22eb831a71292fb04cdf999e28720da3fd7d2d9e (diff) | |
download | mpd-eeb8d0dbcdc213a430ce00057da061a86804fc7b.tar.gz mpd-eeb8d0dbcdc213a430ce00057da061a86804fc7b.tar.xz mpd-eeb8d0dbcdc213a430ce00057da061a86804fc7b.zip |
db/proxy: support empty values in VisitUniqueTags()
Workaround for assertion failure in PrintUniqueTag().
Diffstat (limited to 'src/db')
-rw-r--r-- | src/db/plugins/ProxyDatabasePlugin.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/db/plugins/ProxyDatabasePlugin.cxx b/src/db/plugins/ProxyDatabasePlugin.cxx index 8f9d12188..2bd04e3ad 100644 --- a/src/db/plugins/ProxyDatabasePlugin.cxx +++ b/src/db/plugins/ProxyDatabasePlugin.cxx @@ -779,6 +779,15 @@ ProxyDatabase::VisitUniqueTags(const DatabaseSelection &selection, (pair = mpd_recv_pair_tag(connection, tag_type2)) != nullptr) { TagBuilder tag; tag.AddItem(tag_type, pair->value); + + if (tag.IsEmpty()) + /* if no tag item has been added, then the + given value was not acceptable + (e.g. empty); forcefully insert an empty + tag in this case, as the caller expects the + given tag type to be present */ + tag.AddEmptyItem(tag_type); + result = visit_tag(tag.Commit(), error); mpd_return_pair(connection, pair); } |