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: ce0e898fb4 ('libnm: refactor caching of D-Bus objects in NMClient')
This commit is contained in:
Thomas Haller 2022-07-04 13:46:39 +02:00
parent cadb4fddd2
commit ea85f6dfa3
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -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;
}