1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 07:32:55 +08:00

Fix null checks

This commit is contained in:
Naxess 2021-03-22 17:32:55 +01:00
parent 323b875cea
commit a7076c329c

View File

@ -176,7 +176,7 @@ namespace osu.Game.Rulesets.Objects
List<PathControlPoint> pointsInCurrentSegment = new List<PathControlPoint>(); List<PathControlPoint> pointsInCurrentSegment = new List<PathControlPoint>();
foreach (PathControlPoint point in ControlPoints) foreach (PathControlPoint point in ControlPoints)
{ {
if (point.Type.Value is PathType) if (point.Type.Value != null)
{ {
if (!found) if (!found)
pointsInCurrentSegment.Clear(); pointsInCurrentSegment.Clear();
@ -199,7 +199,7 @@ namespace osu.Game.Rulesets.Objects
private void updatePathTypes() private void updatePathTypes()
{ {
// Updates each segment of the slider once // Updates each segment of the slider once
foreach (PathControlPoint controlPoint in ControlPoints.Where(p => p.Type.Value is PathType)) foreach (PathControlPoint controlPoint in ControlPoints.Where(p => p.Type.Value != null))
updatePathType(controlPoint); updatePathType(controlPoint);
} }