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
This commit is contained in:
Bastien Nocera 2016-06-14 14:12:26 +02:00
parent b0329f8ef6
commit 2a6706fe4c

View file

@ -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;
}
}