serialize: handle case where proxy is None

This commit is contained in:
ThomasV 2015-01-29 11:30:42 +01:00
parent 30763a6555
commit 992a634a77
1 changed files with 2 additions and 0 deletions

View File

@ -39,6 +39,8 @@ proxy_modes = ['socks4', 'socks5', 'http']
import util import util
def serialize_proxy(p): def serialize_proxy(p):
if type(p) != dict:
return None
return ':'.join([p.get('mode'),p.get('host'), p.get('port')]) return ':'.join([p.get('mode'),p.get('host'), p.get('port')])
def deserialize_proxy(s): def deserialize_proxy(s):