From 83fe8514a49de4af590d2d076751220d7e2ba709 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 28 Aug 2017 15:44:05 +0900 Subject: [PATCH] Remove unnecessary exception, replace with default value. --- osu.Game/Graphics/UserInterface/OsuMenu.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuMenu.cs b/osu.Game/Graphics/UserInterface/OsuMenu.cs index fa56b183a5..efc6998ca7 100644 --- a/osu.Game/Graphics/UserInterface/OsuMenu.cs +++ b/osu.Game/Graphics/UserInterface/OsuMenu.cs @@ -52,8 +52,7 @@ namespace osu.Game.Graphics.UserInterface public DrawableOsuMenuItem(MenuItem item) : base(item) { - if (!(Item is OsuMenuItem)) - throw new ArgumentException($"{nameof(item)} must be a {nameof(OsuMenuItem)}."); + } [BackgroundDependencyLoader] @@ -70,8 +69,9 @@ namespace osu.Game.Graphics.UserInterface private void updateTextColour() { - switch (((OsuMenuItem)Item).Type) + switch ((Item as OsuMenuItem)?.Type) { + default: case MenuItemType.Standard: text.Colour = Color4.White; break;