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) if (cache)
dependencies.CacheAs(component); dependencies.CacheAs(component);
var drawableComponent = component as Drawable; var drawableComponent = component as Drawable ?? throw new ArgumentException($"Component must be a {nameof(Drawable)}", nameof(component));
Debug.Assert(drawableComponent != null);
if (component is OsuFocusedOverlayContainer overlay) if (component is OsuFocusedOverlayContainer overlay)
focusedOverlays.Add(overlay); focusedOverlays.Add(overlay);