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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user