diff --git a/CHANGELOG.md b/CHANGELOG.md index fdd3f02..8f04e05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. If there is a `Changed` section please read carefully, as this often means that you will need to adapt your `config.yml`. +## [1.7.3] - 2022-10-20 + +### Fixed 1.7.3 + +* Crash when message has no/invalid metadata + ## [1.7.2] - 2022-10-17 ### Fixed 1.7.2 diff --git a/tts.exe b/tts.exe index 47b5dbb..091fdd9 100644 Binary files a/tts.exe and b/tts.exe differ diff --git a/tts.py b/tts.py index 401a3de..e59f2ea 100644 --- a/tts.py +++ b/tts.py @@ -171,6 +171,8 @@ class IRC: logging.debug('PRIVMSG received') tags = self.__get_tags(resp) + if not tags: + return False message = self.__get_message(resp) self.__priviledged_commands(message, tags) @@ -185,6 +187,7 @@ class IRC: """ tags = resp.split(';') + for tag in tags: if tag.startswith('badges='): badges = tag.rsplit('badges=',1)[1] @@ -199,10 +202,14 @@ class IRC: logging.debug('Username: %s', user) tags = {} - tags['badges'] = badges - tags['subscriber'] = subscriber - tags['msgid'] = msgid - tags['user'] = user + try: + tags['badges'] = badges + tags['subscriber'] = subscriber + tags['msgid'] = msgid + tags['user'] = user + except: # pylint: disable=bare-except + logging.error('Received an invalid message') + return False return tags @@ -1610,7 +1617,7 @@ if __name__ == "__main__": sys.tracebacklimit = 3 - VERSION = "1.7.2" + VERSION = "1.7.3" CONF = {} tts_done = [] MSG_QUEUE_RAW = []