home · contact · privacy
Fix crash on server connect error.
authorChristian Heller <c.heller@plomlompom.de>
Fri, 1 Jul 2016 21:13:19 +0000 (23:13 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Fri, 1 Jul 2016 21:13:19 +0000 (23:13 +0200)
plomlombot.py

index 4c44cf4..80def0d 100755 (executable)
@@ -118,7 +118,10 @@ class IO:
         self.line_buffer = []
         self.rune_buffer = ""
         self.last_pong = time.time()
-        self.servername = self.recv_line(send_ping=False).split(" ")[0][1:]
+        line = self.recv_line(send_ping=False)
+        if not line or len(line) < 1:
+            raise ExceptionForRestart
+        self.servername = line.split(" ")[0][1:]
 
     def _pingtest(self, send_ping=True):
         if self.last_pong + self.timeout < time.time():