From da166edc3f373368078820268e2551e5c44d2cda Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 4 Jul 2022 13:46:39 +0200 Subject: [PATCH] libnm: fix "parameters" argument in nm_client_dbus_call() to be optional It was documented to be an optional parameter. That is also in line with g_dbus_connection_call(), which is essentially wrapped by nm_client_dbus_call(). Fixes: ce0e898fb476 ('libnm: refactor caching of D-Bus objects in NMClient') (cherry picked from commit ea85f6dfa374132a1e3f1de2f6afffb627a05e75) (cherry picked from commit ce629741f1056ffa92df2b240e15b6a55c38add2) --- src/libnm-client-impl/nm-client.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libnm-client-impl/nm-client.c b/src/libnm-client-impl/nm-client.c index cd2aa73055..952ea8439a 100644 --- a/src/libnm-client-impl/nm-client.c +++ b/src/libnm-client-impl/nm-client.c @@ -529,7 +529,6 @@ _nm_client_dbus_call_simple(NMClient *self, nm_assert(object_path); nm_assert(interface_name); nm_assert(method_name); - nm_assert(parameters); nm_assert(reply_type); dbus_context = nm_g_main_context_push_thread_default_if_necessary(priv->dbus_context); @@ -590,20 +589,21 @@ _nm_client_dbus_call(NMClient *self, nm_assert(object_path); nm_assert(interface_name); nm_assert(method_name); - nm_assert(parameters); nm_assert(reply_type); task = nm_g_task_new(source_obj, cancellable, source_tag, user_callback, user_callback_data); if (!self) { - nm_g_variant_unref_floating(parameters); + if (parameters) + nm_g_variant_unref_floating(parameters); g_task_return_error(task, _nm_client_new_error_nm_not_cached()); return; } priv = NM_CLIENT_GET_PRIVATE(self); if (!priv->name_owner) { - nm_g_variant_unref_floating(parameters); + if (parameters) + nm_g_variant_unref_floating(parameters); g_task_return_error(task, _nm_client_new_error_nm_not_running()); return; }