From 2a6706fe4cae955591a2f160639c1e0b05b86c34 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Tue, 14 Jun 2016 14:12:26 +0200 Subject: [PATCH] network: Avoid setting a GError if already set If the wireless security is invalid, don't try to set the GError if the ad-hoc mode is invalid as well. https://bugzilla.gnome.org/show_bug.cgi?id=769230 --- panels/network/connection-editor/ce-page-security.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/panels/network/connection-editor/ce-page-security.c b/panels/network/connection-editor/ce-page-security.c index 041afcd0a..9789c7512 100644 --- a/panels/network/connection-editor/ce-page-security.c +++ b/panels/network/connection-editor/ce-page-security.c @@ -399,7 +399,8 @@ validate (CEPage *page, if (CE_PAGE_SECURITY (page)->adhoc) { if (!wireless_security_adhoc_compatible (sec)) { - g_set_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_SETTING, "Security not compatible with Ad-Hoc mode"); + if (valid) + g_set_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_SETTING, "Security not compatible with Ad-Hoc mode"); valid = FALSE; } }