← Back to team overview

ayatana-commits team mailing list archive

[Branch ~dbusmenu-team/dbusmenu/trunk] Rev 130: Better handling of NULL nodes.

 

Merge authors:
  Ted Gould (ted)
Related merge proposals:
  https://code.launchpad.net/~ted/dbusmenu/null-node-handling/+merge/29419
  proposed by: Ted Gould (ted)
  review: Approve - Cody Russell (bratsche)
------------------------------------------------------------
revno: 130 [merge]
committer: Ted Gould <ted@xxxxxxxx>
branch nick: trunk
timestamp: Wed 2010-07-07 15:57:22 -0500
message:
  Better handling of NULL nodes.
modified:
  libdbusmenu-glib/client.c


--
lp:dbusmenu
https://code.launchpad.net/~dbusmenu-team/dbusmenu/trunk

Your team ayatana-commits is subscribed to branch lp:dbusmenu.
To unsubscribe from this branch go to https://code.launchpad.net/~dbusmenu-team/dbusmenu/trunk/+edit-subscription
=== modified file 'libdbusmenu-glib/client.c'
--- libdbusmenu-glib/client.c	2010-06-11 02:11:45 +0000
+++ libdbusmenu-glib/client.c	2010-07-07 19:45:26 +0000
@@ -561,6 +561,9 @@
 static gint
 parse_node_get_id (xmlNodePtr node)
 {
+	if (node == NULL) {
+		return -1;
+	}
 	if (node->type != XML_ELEMENT_NODE) {
 		return -1;
 	}
@@ -886,6 +889,10 @@
 
 	xmlNodePtr root = xmlDocGetRootElement(xmldoc);
 
+	if (root == NULL) {
+		g_warning("Unable to get root node of menu XML");
+	}
+
 	DbusmenuMenuitem * oldroot = priv->root;
 
 	priv->root = parse_layout_xml(client, root, priv->root, NULL, priv->menuproxy);