Replace null check with assert

This commit is contained in:
Dean Herbert
2021-01-21 14:07:02 +09:00
parent a6516e3be5
commit 0fcf61d352

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System; using System;
using System.Diagnostics;
using System.Linq; using System.Linq;
using JetBrains.Annotations; using JetBrains.Annotations;
using osu.Framework.Allocation; using osu.Framework.Allocation;
@ -131,13 +132,13 @@ namespace osu.Game.Graphics.Containers
public override void Add(T drawable) public override void Add(T drawable)
{ {
base.Add(drawable); base.Add(drawable);
Debug.Assert(drawable != null);
lastKnownScroll = float.NaN; lastKnownScroll = float.NaN;
headerHeight = float.NaN; headerHeight = float.NaN;
footerHeight = float.NaN; footerHeight = float.NaN;
if (drawable == null)
return;
if (smallestSection == null || smallestSection.Height > drawable.Height) if (smallestSection == null || smallestSection.Height > drawable.Height)
smallestSection = drawable; smallestSection = drawable;
} }