diff --git a/panels/network/cc-network-panel.c b/panels/network/cc-network-panel.c index e70562616..496499e50 100644 --- a/panels/network/cc-network-panel.c +++ b/panels/network/cc-network-panel.c @@ -885,18 +885,20 @@ device_off_toggled (GtkSwitch *sw, if (NET_IS_VPN (net_dev)) { NMConnection *connection; - const gchar *path; connection = net_vpn_get_connection (NET_VPN (net_dev)); - path = nm_connection_get_path (connection); if (active) nm_client_activate_connection (panel->priv->client, - path, NULL, NULL, NULL, NULL); + connection, NULL, NULL, + NULL, NULL); else { + const gchar *path; NMActiveConnection *a; const GPtrArray *acs; gint i; + path = nm_connection_get_path (connection); + acs = nm_client_get_active_connections (panel->priv->client); for (i = 0; i < acs->len; i++) { a = (NMActiveConnection*)acs->pdata[i];