Index: gtk/gtkfilesystemmodel.c
===================================================================
--- gtk/gtkfilesystemmodel.c	(revision 17181)
+++ gtk/gtkfilesystemmodel.c	(working copy)
@@ -1166,7 +1166,7 @@ _gtk_file_system_model_path_do (GtkFileS
     return;
 
   paths = g_slist_prepend (paths, gtk_file_path_copy (path));
-  while (gtk_file_path_compare (parent_path, model->root_path) != 0)
+  while (parent_path != NULL && gtk_file_path_compare (parent_path, model->root_path) != 0)
     {
       paths = g_slist_prepend (paths, parent_path);
       if (!gtk_file_system_get_parent (model->file_system, parent_path, &parent_path, NULL))
