mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 17:43:05 +08:00
Fix possible nullref in difficulty recommender
This commit is contained in:
parent
b871ee4e71
commit
6be41e497a
@ -101,10 +101,20 @@ namespace osu.Game.Beatmaps
|
|||||||
/// Rulesets ordered descending by their respective recommended difficulties.
|
/// Rulesets ordered descending by their respective recommended difficulties.
|
||||||
/// The currently selected ruleset will always be first.
|
/// The currently selected ruleset will always be first.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
private IEnumerable<RulesetInfo> orderedRulesets =>
|
private IEnumerable<RulesetInfo> orderedRulesets
|
||||||
recommendedDifficultyMapping
|
{
|
||||||
.OrderByDescending(pair => pair.Value).Select(pair => pair.Key).Where(r => !r.Equals(ruleset.Value))
|
get
|
||||||
|
{
|
||||||
|
if (LoadState < LoadState.Ready || ruleset.Value == null)
|
||||||
|
return Enumerable.Empty<RulesetInfo>();
|
||||||
|
|
||||||
|
return recommendedDifficultyMapping
|
||||||
|
.OrderByDescending(pair => pair.Value)
|
||||||
|
.Select(pair => pair.Key)
|
||||||
|
.Where(r => !r.Equals(ruleset.Value))
|
||||||
.Prepend(ruleset.Value);
|
.Prepend(ruleset.Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void onlineStateChanged(ValueChangedEvent<APIState> state) => Schedule(() =>
|
private void onlineStateChanged(ValueChangedEvent<APIState> state) => Schedule(() =>
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user