# HG changeset patch # User Goffi # Date 1506263358 -7200 # Node ID 47516e90d26a7e85b9c271c4ce8388c0815b693e # Parent 71b10dd7a13afea0d2297bc63d459603d285dd6f jp (pubsub/node/schema): check that a schema exists before parsing it (fix issue on new schema edition) diff -r 71b10dd7a13a -r 47516e90d26a frontends/src/jp/cmd_pubsub.py --- a/frontends/src/jp/cmd_pubsub.py Fri Sep 22 18:04:14 2017 +0200 +++ b/frontends/src/jp/cmd_pubsub.py Sun Sep 24 16:29:18 2017 +0200 @@ -420,11 +420,13 @@ except ImportError: self.disp(u"lxml module must be installed to use edit, please install it with \"pip install lxml\"", error=True) self.host.quit(1) - parser = etree.XMLParser(remove_blank_text=True) - schema_elt = etree.fromstring(schema, parser) content_file_obj, content_file_path = self.getTmpFile() - content_file_obj.write(etree.tostring(schema_elt, encoding="utf-8", pretty_print=True)) - content_file_obj.seek(0) + schema = schema.strip() + if schema: + parser = etree.XMLParser(remove_blank_text=True) + schema_elt = etree.fromstring(schema, parser) + content_file_obj.write(etree.tostring(schema_elt, encoding="utf-8", pretty_print=True)) + content_file_obj.seek(0) self.runEditor("pubsub_schema_editor_args", content_file_path, content_file_obj) def start(self):