Skip to content

Commit

Permalink
Fix handling invalid Windows proxy config (#12595)
Browse files Browse the repository at this point in the history
This fixes NullReferenceException that was thrown if:
-
 HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ProxyEnable was set to true (1)
-
 HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ProxyServer was set to null

Fixes #10030
  • Loading branch information
witcher112 authored and akoeplinger committed Jan 25, 2019
1 parent f96d070 commit 901ca2b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mcs/class/System/ReferenceSources/AutoWebProxyScriptEngine.cs
Expand Up @@ -122,6 +122,11 @@ WebProxyData InitializeRegistryGlobalProxy ()
ArrayList al = new ArrayList ();

string strProxyServer = (string)Microsoft.Win32.Registry.GetValue ("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", "ProxyServer", null);

if(strProxyServer == null) {
return null;
}

string strProxyOverrride = (string)Microsoft.Win32.Registry.GetValue ("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", "ProxyOverride", null);

if (strProxyServer.Contains ("=")) {
Expand Down

0 comments on commit 901ca2b

Please sign in to comment.