From 53c90d5436ff2a60a6b689fddc9e5e79e0dd7b25 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Fri, 1 Jul 2016 23:13:19 +0200 Subject: [PATCH] Fix crash on server connect error. --- plomlombot.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plomlombot.py b/plomlombot.py index 4c44cf4..80def0d 100755 --- a/plomlombot.py +++ b/plomlombot.py @@ -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(): -- 2.30.2