Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some new nullable inspections #25301

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 2 additions & 6 deletions osu.Game.Rulesets.Osu/Objects/Slider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,9 @@ public SliderPath Path
set
{
path.ControlPoints.Clear();
path.ExpectedDistance.Value = null;
path.ControlPoints.AddRange(value.ControlPoints.Select(c => new PathControlPoint(c.Position, c.Type)));

if (value != null)
{
path.ControlPoints.AddRange(value.ControlPoints.Select(c => new PathControlPoint(c.Position, c.Type)));
path.ExpectedDistance.Value = value.ExpectedDistance.Value;
}
path.ExpectedDistance.Value = value.ExpectedDistance.Value;
}
}

Expand Down
2 changes: 2 additions & 0 deletions osu.Game/Rulesets/Edit/SelectionBlueprint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

using System;
using System.Linq;
using JetBrains.Annotations;
using osu.Framework;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
Expand Down Expand Up @@ -51,6 +52,7 @@ protected override void LoadComplete()

private SelectionState state;

[CanBeNull]
public event Action<SelectionState> StateChanged;

public SelectionState State
Expand Down
2 changes: 2 additions & 0 deletions osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ public Background Background

public override void Add(Drawable drawable)
{
ArgumentNullException.ThrowIfNull(drawable);

if (drawable is Background)
throw new InvalidOperationException($"Use {nameof(Background)} to set a background.");

Expand Down
2 changes: 2 additions & 0 deletions osu.Game/Screens/Play/SquareGraph.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using JetBrains.Annotations;
using osu.Framework;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
Expand Down Expand Up @@ -190,6 +191,7 @@ public partial class Column : Container, IStateful<ColumnState>
private const float padding = 2;
public const float WIDTH = cube_size + padding;

[CanBeNull]
public event Action<ColumnState> StateChanged;

private readonly List<Box> drawableRows = new List<Box>();
Expand Down