diff options
-rw-r--r-- | libdbusmenu-glib/client.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 61f8c34..ea77cc3 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -499,6 +499,10 @@ update_layout (DbusmenuClient * client) { DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(client); + if (priv->propproxy == NULL) { + return; + } + if (priv->layoutcall != NULL) { return; } @@ -554,7 +558,8 @@ dbusmenu_client_new (const gchar * name, const gchar * object) it could block longer. Return value: A #DbusmenuMenuitem representing the root of - menu on the server. + menu on the server. If there is no server or there is + an error receiving its layout it'll return #NULL. */ DbusmenuMenuitem * dbusmenu_client_get_root (DbusmenuClient * client) @@ -563,6 +568,10 @@ dbusmenu_client_get_root (DbusmenuClient * client) DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(client); + if (priv->propproxy == NULL) { + return NULL; + } + if (priv->layoutcall != NULL) { /* Will end the current call and block on it's completion */ update_layout_cb(priv->propproxy, priv->layoutcall, client); |