Add out of bound exception for pattern matching

This commit is contained in:
弘韬 张 2020-12-29 17:15:34 +08:00
parent a806f7d05a
commit 4d5119f17d

View file

@ -61,7 +61,7 @@ namespace Flow.Launcher.Infrastructure.Http
{
(_proxy.Address, _proxy.Credentials) = property switch
{
ProxyProperty.Enabled => (Proxy.Enabled) switch
ProxyProperty.Enabled => Proxy.Enabled switch
{
true => Proxy.UserName switch
{
@ -75,7 +75,8 @@ namespace Flow.Launcher.Infrastructure.Http
ProxyProperty.Server => (new Uri($"http://{Proxy.Server}:{Proxy.Port}"), _proxy.Credentials),
ProxyProperty.Port => (new Uri($"http://{Proxy.Server}:{Proxy.Port}"), _proxy.Credentials),
ProxyProperty.UserName => (_proxy.Address, new NetworkCredential(Proxy.UserName, Proxy.Password)),
ProxyProperty.Password => (_proxy.Address, new NetworkCredential(Proxy.UserName, Proxy.Password))
ProxyProperty.Password => (_proxy.Address, new NetworkCredential(Proxy.UserName, Proxy.Password)),
_ => throw new ArgumentOutOfRangeException()
};
}