diff --git a/properties/auth-helpers.c b/properties/auth-helpers.c
index c55afd1..988a4dd 100644
--- a/properties/auth-helpers.c
+++ b/properties/auth-helpers.c
@@ -449,7 +449,7 @@ auth_widget_check_validity (GtkBuilder *builder, const char *contype, GError **e
 	} else if (!strcmp (contype, NM_OPENVPN_CONTYPE_STATIC_KEY)) {
 		widget = GTK_WIDGET (gtk_builder_get_object (builder, "sk_key_chooser"));
 		filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (widget));
-		if (filename && strlen (filename)) {
+		if ( !filename || !strlen (filename)) {
 			g_free (filename);
 			g_set_error (error,
 			             NMV_EDITOR_PLUGIN_ERROR,
