Skip to content

Commit 1c07cb3

Browse files
authored
Merge pull request #1332 from Unity-Technologies/invalid-win-proxy-config-handling-1269569
Fix handling invalid Windows proxy config
2 parents defef06 + 247a0ab commit 1c07cb3

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)