mirror of
https://github.com/ppy/osu
synced 2025-03-22 10:56:54 +00:00
Merge pull request #14204 from peppy/fix-null-ref-online-tracking-component
Fix potential null reference in online status resolution in multiplayer match
This commit is contained in:
commit
b8748a86c5
@ -13,8 +13,16 @@ namespace osu.Game.Database
|
|||||||
public interface IModelManager<TModel>
|
public interface IModelManager<TModel>
|
||||||
where TModel : class
|
where TModel : class
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// A bindable which contains a weak reference to the last item that was updated.
|
||||||
|
/// This is not thread-safe and should be scheduled locally if consumed from a drawable component.
|
||||||
|
/// </summary>
|
||||||
IBindable<WeakReference<TModel>> ItemUpdated { get; }
|
IBindable<WeakReference<TModel>> ItemUpdated { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A bindable which contains a weak reference to the last item that was removed.
|
||||||
|
/// This is not thread-safe and should be scheduled locally if consumed from a drawable component.
|
||||||
|
/// </summary>
|
||||||
IBindable<WeakReference<TModel>> ItemRemoved { get; }
|
IBindable<WeakReference<TModel>> ItemRemoved { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -59,8 +59,8 @@ namespace osu.Game.Online.Rooms
|
|||||||
|
|
||||||
protected override bool VerifyDatabasedModel(BeatmapSetInfo databasedSet)
|
protected override bool VerifyDatabasedModel(BeatmapSetInfo databasedSet)
|
||||||
{
|
{
|
||||||
int? beatmapId = SelectedItem.Value.Beatmap.Value.OnlineBeatmapID;
|
int? beatmapId = SelectedItem.Value?.Beatmap.Value.OnlineBeatmapID;
|
||||||
string checksum = SelectedItem.Value.Beatmap.Value.MD5Hash;
|
string checksum = SelectedItem.Value?.Beatmap.Value.MD5Hash;
|
||||||
|
|
||||||
var matchingBeatmap = databasedSet.Beatmaps.FirstOrDefault(b => b.OnlineBeatmapID == beatmapId && b.MD5Hash == checksum);
|
var matchingBeatmap = databasedSet.Beatmaps.FirstOrDefault(b => b.OnlineBeatmapID == beatmapId && b.MD5Hash == checksum);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user