{
if (!nd) return;
- file_data_unref(nd->fd);
+ if (nd->fd) file_data_unref(nd->fd);
g_free(nd);
}
NodeData *nd;
gtk_tree_model_get(store, &iter, DIR_COLUMN_POINTER, &nd, -1);
- if (strcmp(nd->fd->name, pd->name) == 0)
+ if (nd->fd && strcmp(nd->fd->name, pd->name) == 0)
{
fd = nd->fd;
}
/* all nodes are created with an "empty" node, so that the expander is shown
* this is removed when the child is populated */
end = g_new0(NodeData, 1);
- end->fd = file_data_new_simple("");
+ end->fd = NULL;
end->expanded = TRUE;
gtk_tree_store_append(store, &empty, &child);
if (nd->expanded)
{
- if (!isdir(nd->fd->path))
+ if (!nd->fd || !isdir(nd->fd->path))
{
if (vd->click_fd == nd->fd) vd->click_fd = NULL;
if (vd->drop_fd == nd->fd) vd->drop_fd = NULL;
gtk_tree_model_get(store, a, DIR_COLUMN_POINTER, &nda, -1);
gtk_tree_model_get(store, b, DIR_COLUMN_POINTER, &ndb, -1);
+ if (!nda->fd && !ndb->fd) return 0;
+ if (!nda->fd) return 1;
+ if (!ndb->fd) return -1;
+
if (options->file_sort.case_sensitive)
return strcmp(nda->fd->collate_key_name, ndb->fd->collate_key_name);
else