Browse Source

Do not crash on privmsg with no content

There is a corner case (/dcc chat) where a privmsg can have no content.
Ignore such corner cases instead of crashing.

Change-Id: Ia07c76c4a2342bb4e7bc9c37a4944d4b9f18efd8
changes/84/732684/1
Thierry Carrez 1 month ago
parent
commit
1db00eafb8
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      ptgbot/bot.py

+ 3
- 0
ptgbot/bot.py View File

@@ -96,6 +96,9 @@ class PTGBot(SASL, SSL, irc.bot.SingleServerIRCBot):
nick = e.source.split('!')[0]
msg = e.arguments[0][1:]
words = msg.split()
if len(words) < 1:
self.log.debug("Ignoring privmsg with no content")
return
cmd = words[0].lower()
words.pop(0)



Loading…
Cancel
Save