summaryrefslogtreecommitdiff
path: root/src/connection.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2012-06-01 22:46:21 +0200
committermathieui <mathieui@mathieui.net>2012-06-01 22:46:21 +0200
commita7e3814c0912e9ab75f7c1f845b997660f08e3c0 (patch)
treebbdb22a4f97659295d33856fdcb519d8a0c175b8 /src/connection.py
parent915dc7fa9d75409748d32a7627a434c388cdadcd (diff)
downloadpoezio-a7e3814c0912e9ab75f7c1f845b997660f08e3c0.tar.gz
poezio-a7e3814c0912e9ab75f7c1f845b997660f08e3c0.tar.bz2
poezio-a7e3814c0912e9ab75f7c1f845b997660f08e3c0.tar.xz
poezio-a7e3814c0912e9ab75f7c1f845b997660f08e3c0.zip
Prevent a crash when the value of custom_port is not expected
Diffstat (limited to 'src/connection.py')
-rw-r--r--src/connection.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/connection.py b/src/connection.py
index f3ff0a30..cf7ff72c 100644
--- a/src/connection.py
+++ b/src/connection.py
@@ -77,6 +77,8 @@ class Connection(sleekxmpp.ClientXMPP):
# (domain, config.get('port', 5222))
custom_host = config.get('custom_host', '')
custom_port = config.get('custom_port', 5222)
+ if custom_port == -1:
+ custom_port = 5222
if custom_host:
res = self.connect((custom_host, custom_port), reattempt=False)
elif custom_port != 5222 and custom_port != -1: