From ea85f6dfa374132a1e3f1de2f6afffb627a05e75 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') --- 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 f7bd2db545..a2ca833336 100644 --- a/src/libnm-client-impl/nm-client.c +++ b/src/libnm-client-impl/nm-client.c @@ -531,7 +531,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); @@ -592,20 +591,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; }