summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--player/scripting.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/player/scripting.c b/player/scripting.c
index 0393427bef..1efe6389f6 100644
--- a/player/scripting.c
+++ b/player/scripting.c
@@ -151,7 +151,8 @@ static char **list_script_files(void *talloc_ctx, char *path)
MP_TARRAY_APPEND(talloc_ctx, files, count, fname);
}
closedir(dp);
- qsort(files, count, sizeof(char *), compare_filename);
+ if (files)
+ qsort(files, count, sizeof(char *), compare_filename);
MP_TARRAY_APPEND(talloc_ctx, files, count, NULL);
return files;
}