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:
parent
25f1f772f3
commit
fea4632e83
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user