diff --git a/pym/format/patch.py b/pym/format/patch.py index 91dbde4..de73890 100644 --- a/pym/format/patch.py +++ b/pym/format/patch.py @@ -76,6 +76,12 @@ class patch(_error): if node.tagName == "reg": if node.firstChild: reText = node.firstChild.nodeValue + if reText is None: + textNode = node.toxml().encode("UTF8") + self.setError(\ + _("Incorrect text template")+ ": \n" +\ + "%s" %textNode) + return False else: self.setError(\ _("Incorrect text template ''")) @@ -91,11 +97,16 @@ class patch(_error): self.setError(\ _("Incorrect text template '%s'")\ %reText) - return False elif node.tagName == "text" and regex: if node.firstChild: text = node.firstChild.nodeValue + if text is None: + textNode = node.toxml().encode("UTF8") + self.setError(\ + _("Incorrect text template")+ ": \n" +\ + "%s" %textNode) + return False else: text = "" dataList.append((regex, text))