1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 18:52:55 +08:00

Convert assert to hard throw

This commit is contained in:
Dean Herbert 2022-04-18 20:04:19 +09:00
parent 25f1f772f3
commit fea4632e83

View File

@ -988,8 +988,7 @@ namespace osu.Game
if (cache)
dependencies.CacheAs(component);
var drawableComponent = component as Drawable;
Debug.Assert(drawableComponent != null);
var drawableComponent = component as Drawable ?? throw new ArgumentException($"Component must be a {nameof(Drawable)}", nameof(component));
if (component is OsuFocusedOverlayContainer overlay)
focusedOverlays.Add(overlay);