diff --git a/Netch/Forms/Mode/Process.cs b/Netch/Forms/Mode/Process.cs index 546cd5f7..15eecdf1 100644 --- a/Netch/Forms/Mode/Process.cs +++ b/Netch/Forms/Mode/Process.cs @@ -24,7 +24,7 @@ namespace Netch.Forms.Mode /// 模式 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(); diff --git a/Netch/Forms/Mode/Route.cs b/Netch/Forms/Mode/Route.cs index b66dedc5..d6f44f02 100644 --- a/Netch/Forms/Mode/Route.cs +++ b/Netch/Forms/Mode/Route.cs @@ -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;