[Xfce4-commits] [xfce/xfce4-panel] 17/24: Send dummy arguments for add_new_item dbus method

noreply at xfce.org noreply at xfce.org
Tue Jul 4 00:03:48 CEST 2017


This is an automated email from the git hooks/post-receive script.

o   c   h   o   s   i       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/xfce4-panel.

commit 2de3bfd7056da3ec3ced02784ef12f6f7f795a46
Author: Ali Abdallah <ali at xfce.org>
Date:   Tue Jun 27 21:25:57 2017 +0200

    Send dummy arguments for add_new_item dbus method
    
    When no arguments are given this helps avoid a crash on g_variant_new_strv.
---
 panel/panel-dbus-client.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/panel/panel-dbus-client.c b/panel/panel-dbus-client.c
index f86e1e1..5f748f5 100644
--- a/panel/panel-dbus-client.c
+++ b/panel/panel-dbus-client.c
@@ -142,6 +142,7 @@ panel_dbus_client_add_new_item (const gchar  *plugin_name,
 
   XfcePanelExportedService *dbus_proxy;
   gboolean                  result;
+  const gchar              *empty_arguments[] = {"", NULL};
 
   panel_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
@@ -149,10 +150,16 @@ panel_dbus_client_add_new_item (const gchar  *plugin_name,
   if (G_UNLIKELY (dbus_proxy == NULL))
     return FALSE;
 
-  result = xfce_panel_exported_service_call_add_new_item_sync (dbus_proxy, plugin_name,
-                                                               (const gchar **) arguments,
-                                                               NULL,
-                                                               error);
+  if (arguments != NULL && *arguments != NULL)
+    result = xfce_panel_exported_service_call_add_new_item_sync (dbus_proxy, plugin_name,
+                                                                 (const gchar **) arguments,
+                                                                 NULL,
+                                                                 error);
+  else
+    result = xfce_panel_exported_service_call_add_new_item_sync (dbus_proxy, plugin_name,
+                                                                 empty_arguments,
+                                                                 NULL,
+                                                                 error);
 
   g_object_unref (G_OBJECT (dbus_proxy));
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list