Skip to content
Snippets Groups Projects
Commit 2501fb1a authored by Yorhel's avatar Yorhel
Browse files

Fix crash when attempting to sort an empty directory

I had taken care to not sort empty directories during dirlist_open(),
but forgot that manual user actions can still cause dirlist_set_sort()
to be called, which does not handle empty directories.

Reported by Alex Wilson.
parent 93583e64
No related branches found
No related tags found
No related merge requests found
......@@ -371,7 +371,8 @@ void dirlist_set_sort(int col, int desc, int df) {
dirlist_sort_df = df;
/* sort the list (excluding the parent, which is always on top) */
head_real = dirlist_sort(head_real);
if(head_real)
head_real = dirlist_sort(head_real);
if(dirlist_parent)
dirlist_parent->next = head_real;
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment