diff options
-rw-r--r-- | libappstream-glib/as-node.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libappstream-glib/as-node.c b/libappstream-glib/as-node.c index 83c883f..a953e72 100644 --- a/libappstream-glib/as-node.c +++ b/libappstream-glib/as-node.c @@ -326,8 +326,10 @@ as_node_to_xml_string (GString *xml, } else if (n->children == NULL) { if ((flags & AS_NODE_TO_XML_FLAG_FORMAT_INDENT) > 0) as_node_add_padding (xml, depth - depth_offset); - attrs = as_node_get_attr_string (data); tag_str = as_tag_data_get_name (data); + if (tag_str == NULL) + return; + attrs = as_node_get_attr_string (data); if (data->cdata == NULL || data->cdata[0] == '\0') { g_string_append_printf (xml, "<%s%s/>", tag_str, attrs); |