summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2015-11-01 13:34:06 +0100
committerLubomir Rintel <lkundrak@v3.sk>2015-11-01 14:11:15 +0100
commita267ebc33759a69bb9c96a2fd9e460e4b3af5f43 (patch)
tree3d5de4d12a42904f66732b03b7405156e0ebd806
parent213f43df027c833c345ebabfc15ede47f0760b4a (diff)
downloadnetwork-manager-applet-a267ebc33759a69bb9c96a2fd9e460e4b3af5f43.tar.gz
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).
-rw-r--r--src/connection-editor/nm-connection-editor.c3
-rw-r--r--src/connection-editor/nm-connection-list.c6
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 8de06809..aff0f468 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 d961b1fe..e28da679 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