diff options
author | Max Kellermann <max@musicpd.org> | 2016-10-26 18:47:19 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2016-10-26 18:47:19 +0200 |
commit | 086652dd505285695418f46d83d18a82679ace37 (patch) | |
tree | 22bed586cd401123a954ef7cff16d2e4de22c899 /src/db/DatabaseQueue.cxx | |
parent | 6135f0763b976829ddc8335f08258e6c6984fc6a (diff) |
Instance: add GetDatabaseOrThrow()
Diffstat (limited to 'src/db/DatabaseQueue.cxx')
-rw-r--r-- | src/db/DatabaseQueue.cxx | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/db/DatabaseQueue.cxx b/src/db/DatabaseQueue.cxx index 2dac3d5cd..07869c032 100644 --- a/src/db/DatabaseQueue.cxx +++ b/src/db/DatabaseQueue.cxx @@ -41,11 +41,9 @@ bool AddFromDatabase(Partition &partition, const DatabaseSelection &selection, Error &error) { - const Database *db = partition.instance.GetDatabase(error); - if (db == nullptr) - return false; + const Database &db = partition.instance.GetDatabaseOrThrow(); using namespace std::placeholders; const auto f = std::bind(AddToQueue, std::ref(partition), _1); - return db->Visit(selection, f, error); + return db.Visit(selection, f, error); } |