diff options
author | Ted Gould <ted@gould.cx> | 2010-04-14 17:07:14 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-04-14 17:07:14 -0500 |
commit | a341d130bea321f026e897381d0b983a626a6549 (patch) | |
tree | 5f689dccd0a7bc02df8f60302488cdf8a0f4c70e /libdbusmenu-glib/server.c | |
parent | b7828c57bb679c28e14c955a19069451e156568a (diff) | |
parent | 9284777a7a53b0aa247b63d8b99359be7dd88296 (diff) | |
download | libdbusmenu-a341d130bea321f026e897381d0b983a626a6549.tar.gz libdbusmenu-a341d130bea321f026e897381d0b983a626a6549.tar.bz2 libdbusmenu-a341d130bea321f026e897381d0b983a626a6549.zip |
* Upstream Merge
* Don't allow setting children twice
* Ref children of a menuitem
* Return error when parent ID of getlayout can't be found
Diffstat (limited to 'libdbusmenu-glib/server.c')
-rw-r--r-- | libdbusmenu-glib/server.c | 10 |
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); |