diff options
Diffstat (limited to 'src/tabs/xmltab.py')
-rw-r--r-- | src/tabs/xmltab.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/tabs/xmltab.py b/src/tabs/xmltab.py index 6899cd6f..24187605 100644 --- a/src/tabs/xmltab.py +++ b/src/tabs/xmltab.py @@ -137,8 +137,11 @@ class XMLTab(Tab): self.filters.append(matcher) new_messages = [] for msg in messages: - if self.match_stanza(ElementBase(ET.fromstring(clean_text(msg.txt)))): - new_messages.append(msg) + try: + if msg.txt.strip() and self.match_stanza(ElementBase(ET.fromstring(clean_text(msg.txt)))): + new_messages.append(msg) + except ET.ParseError: + log.debug('Malformed XML : %s', msg.txt, exc_info=True) self.filtered_buffer.messages = new_messages self.text_win.rebuild_everything(self.filtered_buffer) self.gen_filter_repr() |