Update Edit Mode Form ctor check mode

This commit is contained in:
ChsBuffer
2021-02-23 14:08:07 +08:00
parent 210bafb33f
commit ba646e43e3
2 changed files with 2 additions and 2 deletions

View File

@@ -24,7 +24,7 @@ namespace Netch.Forms.Mode
/// <param name="mode">模式</param>
public Process(Models.Mode mode = null)
{
if ((mode?.Type ?? 0) is not 0)
if (mode != null && mode.Type is not 0)
throw new ArgumentOutOfRangeException();
InitializeComponent();

View File

@@ -34,7 +34,7 @@ namespace Netch.Forms.Mode
public Route(Models.Mode mode = null)
{
if ((mode?.Type ?? 1) is not (1 or 2))
if (mode != null && mode.Type is not (1 or 2))
throw new ArgumentOutOfRangeException();
_mode = mode;