From a7e3814c0912e9ab75f7c1f845b997660f08e3c0 Mon Sep 17 00:00:00 2001
From: mathieui <mathieui@mathieui.net>
Date: Fri, 1 Jun 2012 22:46:21 +0200
Subject: Prevent a crash when the value of custom_port is not expected

---
 src/connection.py | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'src')

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:
-- 
cgit v1.2.3