[network-manager-applet] connection-editor: fix error handling when we can't create an editor



commit a267ebc33759a69bb9c96a2fd9e460e4b3af5f43
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Sun Nov 1 13:34:06 2015 +0100

    connection-editor: fix error handling when we can't create an editor
    
    nm_connection_editor_run() can fail creating the editor window (e.g. VPN
    connection with no plugin to handle it).

 src/connection-editor/nm-connection-editor.c |    3 ++-
 src/connection-editor/nm-connection-list.c   |    6 ++++--
 2 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/connection-editor/nm-connection-editor.c b/src/connection-editor/nm-connection-editor.c
index 8de0680..aff0f46 100644
--- a/src/connection-editor/nm-connection-editor.c
+++ b/src/connection-editor/nm-connection-editor.c
@@ -317,7 +317,8 @@ dispose (GObject *object)
                goto out;
        editor->disposed = TRUE;
 
-       g_hash_table_remove (active_editors, editor->orig_connection);
+       if (active_editors)
+               g_hash_table_remove (active_editors, editor->orig_connection);
 
        g_slist_foreach (editor->initializing_pages, (GFunc) g_object_unref, NULL);
        g_slist_free (editor->initializing_pages);
diff --git a/src/connection-editor/nm-connection-list.c b/src/connection-editor/nm-connection-list.c
index d961b1f..e28da67 100644
--- a/src/connection-editor/nm-connection-list.c
+++ b/src/connection-editor/nm-connection-list.c
@@ -341,8 +341,10 @@ edit_connection (NMConnectionList *list, NMConnection *connection)
        editor = nm_connection_editor_new (GTK_WINDOW (list->dialog),
                                           NM_CONNECTION (connection),
                                           list->client);
-       g_signal_connect (editor, "done", G_CALLBACK (edit_done_cb), list);
-       nm_connection_editor_run (editor);
+       if (editor) {
+               g_signal_connect (editor, "done", G_CALLBACK (edit_done_cb), list);
+               nm_connection_editor_run (editor);
+       }
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]