1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-22 19:41:06 +08:00

Adjust beatmap query to fix potential crash

This commit is contained in:
Dan Balasescu
2026-01-05 17:15:18 +09:00
Unverified
parent ea289460b0
commit 78a5654e1f
+5 -1
View File
@@ -334,7 +334,11 @@ namespace osu.Game.Beatmaps
/// <returns>A matching local beatmap info if existing and in a valid state.</returns>
public BeatmapInfo? QueryOnlineBeatmapId(int id) => Realm.Run(r =>
r.All<BeatmapInfo>()
.ForOnlineId(id).SingleOrDefault()?.Detach());
.ForOnlineId(id)
// See https://github.com/ppy/osu/issues/36234 for why this isn't a SingleOrDefault().
.FirstOrDefault()
?.Detach()
);
/// <summary>
/// A default representation of a WorkingBeatmap to use when no beatmap is available.