From dd6d72d6a13267033dfd6d36519118b901a36e4e Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 28 Dec 2010 16:40:07 -0600 Subject: [PATCH] libnm-glib: handle errors on AddConnection reply --- libnm-glib/nm-remote-settings.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libnm-glib/nm-remote-settings.c b/libnm-glib/nm-remote-settings.c index 872babeb4b..3369860e8c 100644 --- a/libnm-glib/nm-remote-settings.c +++ b/libnm-glib/nm-remote-settings.c @@ -394,10 +394,13 @@ add_connection_done (DBusGProxy *proxy, { AddConnectionInfo *info = user_data; - info->connection = new_connection_cb (proxy, path, info->self); - g_assert (info->connection); - - /* Wait until this connection is fully initialized before calling the callback */ + if (error) { + add_connection_info_complete (info->self, info, error); + } else { + info->connection = new_connection_cb (proxy, path, info->self); + g_assert (info->connection); + /* Wait until this connection is fully initialized before calling the callback */ + } g_free (path); }