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 4c44cf4a525d2c7955af0f38cd08aa795b0c729c..80def0db6990eba4dd76fd180529e648cf8c3883 100755 (executable)
@@ -118,7 +118,10 @@ class IO:
         self.line_buffer = []
         self.rune_buffer = ""
         self.last_pong = time.time()
         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():
 
     def _pingtest(self, send_ping=True):
         if self.last_pong + self.timeout < time.time():