diff --git a/configure.ac b/configure.ac index ac3443a903dcb1a9323c37ba223ccf5e28d7a0d1..9c0fbb6605868398f0c77a780a309899d6030b70 100644 --- a/configure.ac +++ b/configure.ac @@ -12,7 +12,7 @@ # Release Version m4_define([project_major_version], [0]) m4_define([project_minor_version], [8]) -m4_define([project_micro_version], [0]) +m4_define([project_micro_version], [1]) m4_define([project_nano_version], [0]) # LT_VERSION @@ -22,7 +22,7 @@ m4_define([project_nano_version], [0]) # If public symbols have been added since last release, increment age # If public symbols have been removed since last release, set age to 0 m4_define([project_lt_current], [8]) -m4_define([project_lt_revision], [0]) +m4_define([project_lt_revision], [1]) m4_define([project_lt_age], [0]) # Combine numbers to various version variables (different uses) diff --git a/gxml/libxml-Document.vala b/gxml/libxml-Document.vala index a160599f112d083fb6a0d8ea4f32a93945e82166..dfe279027628db31094e8e0953922d1744555b46 100644 --- a/gxml/libxml-Document.vala +++ b/gxml/libxml-Document.vala @@ -475,6 +475,8 @@ namespace GXml { public xDocument.from_string (string xml) { Xml.Doc *doc; doc = Xml.Parser.parse_memory (xml, (int)xml.length); + if (doc == null) + doc = new Xml.Doc (); this.from_libxml2 (doc); } /** diff --git a/test/DocumentTest.vala b/test/DocumentTest.vala index afb839136c1ad551eccb285d9e745708526f8a91..4829fe1a0e8d6ef75efbfe5d0c92e39b7ba0f19e 100644 --- a/test/DocumentTest.vala +++ b/test/DocumentTest.vala @@ -143,6 +143,17 @@ class DocumentTest : GXmlTest { assert (root.first_child.node_name == "Apple"); assert (root.last_child.node_name == "Orange"); }); + Test.add_func ("/gxml/document/construct_from_string_no_root", () => { + string xml; + xDocument doc; + GXml.xNode root; + + xml = """"""; + doc = new xDocument.from_string (xml); + + root = doc.document_element; + assert (root == null); + }); Test.add_func ("/gxml/document/save", () => { xDocument doc; int exit_status;