aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-glib/server.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-04-15 01:23:10 -0500
committerTed Gould <ted@gould.cx>2010-04-15 01:23:10 -0500
commit490c7b4de7274d4c0c3529ff01bacb829d6aa4c8 (patch)
tree4b1fa3f794991102ea5a085df14b6a293b690a7b /libdbusmenu-glib/server.c
parentb76efc8297f488efce9e4fddf9e705c75a27065e (diff)
parent7bf97e72be70cf02997eca526aaac68df4494165 (diff)
downloadlibdbusmenu-490c7b4de7274d4c0c3529ff01bacb829d6aa4c8.tar.gz
libdbusmenu-490c7b4de7274d4c0c3529ff01bacb829d6aa4c8.tar.bz2
libdbusmenu-490c7b4de7274d4c0c3529ff01bacb829d6aa4c8.zip
* Upstream Merge
* Changing GTK layer to look at position in realized children to avoid realization races. (LP: #555816) * Don't allow setting children twice * Ref children of a menuitem * Return error when parent ID of getlayout can't be found * Adding in visible property to docs * Helpful comments in the code
Diffstat (limited to 'libdbusmenu-glib/server.c')
-rw-r--r--libdbusmenu-glib/server.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c
index d87c024..02c9c57 100644
--- a/libdbusmenu-glib/server.c
+++ b/libdbusmenu-glib/server.c
@@ -404,6 +404,16 @@ _dbusmenu_server_get_layout (DbusmenuServer * server, gint parent, guint * revis
}
} else {
DbusmenuMenuitem * item = dbusmenu_menuitem_find_id(priv->root, parent);
+ if (item == NULL) {
+ if (error != NULL) {
+ g_set_error(error,
+ error_quark(),
+ INVALID_MENUITEM_ID,
+ "The ID supplied %d does not refer to a menu item we have",
+ parent);
+ }
+ return FALSE;
+ }
dbusmenu_menuitem_buildxml(item, xmlarray);
}
g_ptr_array_add(xmlarray, NULL);