Index: gtkfilechooser.c
===================================================================
--- gtkfilechooser.c	(revision 21112)
+++ gtkfilechooser.c	(working copy)
@@ -647,6 +647,7 @@
   
   g_return_val_if_fail (GTK_IS_FILE_CHOOSER (chooser), FALSE);
   g_return_val_if_fail (filename != NULL, FALSE);
+  g_return_val_if_fail (g_file_test(filename, G_FILE_TEST_IS_DIR), FALSE);
 
   file = g_file_new_for_path (filename);
   result = gtk_file_chooser_set_current_folder_file (chooser, file, NULL);
