diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2016-05-13 11:06:12 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2016-05-13 14:53:34 +0200 |
commit | 2af8361c71416c61b96d01423b1a95d3bc692f9d (patch) | |
tree | 877454f2477139ee2c44206cb3442b0cd087b79e | |
parent | 8e60431a7d6fc4c5545e58464e10b9131cbd3e6a (diff) | |
download | network-manager-applet-2af8361c71416c61b96d01423b1a95d3bc692f9d.tar.gz |
wireless-security: return error on eap_method_validate_filepicker() failure
-rw-r--r-- | src/wireless-security/eap-method.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/wireless-security/eap-method.c b/src/wireless-security/eap-method.c index 3c7b4544..36e34ae2 100644 --- a/src/wireless-security/eap-method.c +++ b/src/wireless-security/eap-method.c @@ -226,8 +226,13 @@ eap_method_validate_filepicker (GtkBuilder *builder, widget = GTK_WIDGET (gtk_builder_get_object (builder, name)); g_assert (widget); filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (widget)); - if (!filename) - return (item_type == TYPE_CA_CERT) ? TRUE : FALSE; + if (!filename) { + if (item_type == TYPE_CA_CERT) + success = TRUE; + else + g_set_error_literal (error, NMA_ERROR, NMA_ERROR_GENERIC, _("no file selected")); + goto out; + } if (!g_file_test (filename, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)) goto out; |