From 121cc1772eecc055d12cd91c1bef2c3345aa3843 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Tue, 25 Mar 2014 14:24:35 +0000 Subject: [PATCH] MessageParser: Fix crash if not all matches are used in the replacement. --- plugins/MessageParser/plugin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/MessageParser/plugin.py b/plugins/MessageParser/plugin.py index 825502959..821846894 100644 --- a/plugins/MessageParser/plugin.py +++ b/plugins/MessageParser/plugin.py @@ -171,7 +171,8 @@ class MessageParser(callbacks.Plugin, plugins.ChannelDBHandler): thisaction = action self._updateRank(channel, regexp) for (i, j) in enumerate(match.groups()): - thisaction = re.sub(r'\$' + str(i+1), match.group(i+1), thisaction) + if match.group(i+1): + thisaction = re.sub(r'\$' + str(i+1), match.group(i+1), thisaction) actions.append(thisaction) if max_triggers != 0 and max_triggers == len(actions): break