Skip to content

Commit 4d5119f

Browse files
committed
Add out of bound exception for pattern matching
1 parent a806f7d commit 4d5119f

File tree

1 file changed

+3
-2
lines changed
  • Flow.Launcher.Infrastructure/Http

1 file changed

+3
-2
lines changed

Flow.Launcher.Infrastructure/Http/Http.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public static void UpdateProxy(ProxyProperty property)
6161
{
6262
(_proxy.Address, _proxy.Credentials) = property switch
6363
{
64-
ProxyProperty.Enabled => (Proxy.Enabled) switch
64+
ProxyProperty.Enabled => Proxy.Enabled switch
6565
{
6666
true => Proxy.UserName switch
6767
{
@@ -75,7 +75,8 @@ public static void UpdateProxy(ProxyProperty property)
7575
ProxyProperty.Server => (new Uri($"http://{Proxy.Server}:{Proxy.Port}"), _proxy.Credentials),
7676
ProxyProperty.Port => (new Uri($"http://{Proxy.Server}:{Proxy.Port}"), _proxy.Credentials),
7777
ProxyProperty.UserName => (_proxy.Address, new NetworkCredential(Proxy.UserName, Proxy.Password)),
78-
ProxyProperty.Password => (_proxy.Address, new NetworkCredential(Proxy.UserName, Proxy.Password))
78+
ProxyProperty.Password => (_proxy.Address, new NetworkCredential(Proxy.UserName, Proxy.Password)),
79+
_ => throw new ArgumentOutOfRangeException()
7980
};
8081
}
8182

0 commit comments

Comments
 (0)