E5Network/E5NetworkProxyFactory.py

changeset 317
f6b0163a21be
parent 289
baf4c1354c6a
child 319
09f456ec6fcf
diff -r b7e499650928 -r f6b0163a21be E5Network/E5NetworkProxyFactory.py
--- a/E5Network/E5NetworkProxyFactory.py	Sun May 30 19:50:57 2010 +0200
+++ b/E5Network/E5NetworkProxyFactory.py	Mon May 31 15:15:20 2010 +0200
@@ -105,14 +105,15 @@
                                                   url.userName(), url.password())
                             proxyList = [proxy]
                             break
-                scheme = schemeFromProxyType(proxyList[0].type())
-                if scheme == "":
-                    scheme = "Http"
-                if scheme != "NoProxy":
-                    proxyList[0].setUser(
-                        Preferences.getUI("ProxyUser/{0}".format(scheme)))
-                    proxyList[0].setPassword(
-                        Preferences.getUI("ProxyPassword/{0}".format(scheme)))
+                if proxyList:
+                    scheme = schemeFromProxyType(proxyList[0].type())
+                    if scheme == "":
+                        scheme = "Http"
+                    if scheme != "NoProxy":
+                        proxyList[0].setUser(
+                            Preferences.getUI("ProxyUser/{0}".format(scheme)))
+                        proxyList[0].setPassword(
+                            Preferences.getUI("ProxyPassword/{0}".format(scheme)))
                 return proxyList
             else:
                 if Preferences.getUI("UseHttpProxyForAll"):

eric ide

mercurial