aboutsummaryrefslogtreecommitdiffstats
path: root/src/SongLoader.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/SongLoader.cxx')
-rw-r--r--src/SongLoader.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/SongLoader.cxx b/src/SongLoader.cxx
index 2ed34671c..90df42824 100644
--- a/src/SongLoader.cxx
+++ b/src/SongLoader.cxx
@@ -92,11 +92,12 @@ SongLoader::LoadSong(const char *uri_utf8, Error &error) const
/* URI relative to the music directory */
#ifdef ENABLE_DATABASE
- return DatabaseDetachSong(uri_utf8, error);
-#else
+ if (db != nullptr)
+ return DatabaseDetachSong(*db, uri_utf8, error);
+#endif
+
error.Set(playlist_domain, int(PlaylistResult::NO_SUCH_SONG),
"No database");
return nullptr;
-#endif
}
}