Merge pull request #11625 from peppy/fix-beatmap-cache-lookup-null-failure

Fix SQLite exception thrown is a beatmap lookup is attempted without an OnlineBeatmapID present
This commit is contained in:
Bartłomiej Dach 2021-01-29 18:58:00 +01:00 committed by GitHub
commit 44e88f09e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -160,7 +160,7 @@ private bool checkLocalCache(BeatmapSetInfo set, BeatmapInfo beatmap)
cmd.CommandText = "SELECT beatmapset_id, beatmap_id, approved FROM osu_beatmaps WHERE checksum = @MD5Hash OR beatmap_id = @OnlineBeatmapID OR filename = @Path";
cmd.Parameters.Add(new SqliteParameter("@MD5Hash", beatmap.MD5Hash));
cmd.Parameters.Add(new SqliteParameter("@OnlineBeatmapID", beatmap.OnlineBeatmapID));
cmd.Parameters.Add(new SqliteParameter("@OnlineBeatmapID", beatmap.OnlineBeatmapID ?? (object)DBNull.Value));
cmd.Parameters.Add(new SqliteParameter("@Path", beatmap.Path));
using (var reader = cmd.ExecuteReader())