From 6998c0d1874b0df4e8cb3a1f7233c20539d1d615 Mon Sep 17 00:00:00 2001 From: Juhani Haverinen Date: Sat, 5 Sep 2015 17:12:50 +0300 Subject: [PATCH] Ignore malformed entries in msgs.txt --- botcmd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/botcmd.py b/botcmd.py index e957b65..b12de7d 100644 --- a/botcmd.py +++ b/botcmd.py @@ -78,7 +78,7 @@ def loadmessages(): for line in f: while len(line) > 0 and line[-1] == '\n': line = line[:-1] - if len(line) > 0: + if len(line.split('\t')) == 3: receiver, sender, msg = line.split('\t') if receiver not in msgs: msgs[receiver] = []