From 4e731945009b4475e7b08b25c7af88efcf7b5977 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Wed, 16 Mar 2011 15:36:36 -0500 Subject: [PATCH] libnm-glib: allow calling nm_remote_connection_delete() without a callback --- libnm-glib/nm-remote-connection.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libnm-glib/nm-remote-connection.c b/libnm-glib/nm-remote-connection.c index 2a366a6127..f7095d78b4 100644 --- a/libnm-glib/nm-remote-connection.c +++ b/libnm-glib/nm-remote-connection.c @@ -145,14 +145,15 @@ delete_cb (DBusGProxy *proxy, GError *error, gpointer user_data) RemoteCall *call = user_data; NMRemoteConnectionDeleteFunc func = (NMRemoteConnectionDeleteFunc) call->callback; - (*func)(call->self, error, call->user_data); + if (func != NULL) + (*func)(call->self, error, call->user_data); remote_call_complete (call->self, call); } /** * nm_remote_connection_delete: * @connection: the #NMRemoteConnection - * @callback: (scope async): a function to be called when the delete completes + * @callback: (scope async allow-none): a function to be called when the delete completes * @user_data: caller-specific data to be passed to @callback * * Delete the connection. @@ -167,7 +168,6 @@ nm_remote_connection_delete (NMRemoteConnection *self, g_return_if_fail (self != NULL); g_return_if_fail (NM_IS_REMOTE_CONNECTION (self)); - g_return_if_fail (callback != NULL); priv = NM_REMOTE_CONNECTION_GET_PRIVATE (self);