Skip to content

Commit 247a0ab

Browse files
iRebbokUnityAlex
authored andcommitted
Fix handling invalid Windows proxy config
source: mono#12595 Re-adding whitespace to reduce diff noise and make future cherrypicks easier.
1 parent defef06 commit 247a0ab

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mcs/class/System/ReferenceSources/AutoWebProxyScriptEngine.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,11 @@ WebProxyData InitializeRegistryGlobalProxy ()
131131

132132
string strProxyServer = (string)Microsoft.Win32.Registry.GetValue ("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", "ProxyServer", null);
133133
string strProxyOverrride = (string)Microsoft.Win32.Registry.GetValue ("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", "ProxyOverride", null);
134-
134+
135+
if(strProxyServer == null) {
136+
return null;
137+
}
138+
135139
if (strProxyServer.Contains ("=")) {
136140
foreach (string strEntry in strProxyServer.Split (new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
137141
if (strEntry.StartsWith ("http=")) {

0 commit comments

Comments
 (0)