diff --git a/libguile/sort.c b/libguile/sort.c index ff33e1ee8..f40d62a7b 100644 --- a/libguile/sort.c +++ b/libguile/sort.c @@ -531,6 +531,9 @@ SCM_DEFINE (scm_stable_sort, "stable-sort", 2, 0, 0, "This is a stable sort.") #define FUNC_NAME s_scm_stable_sort { + if (SCM_NULL_OR_NIL_P (items)) + return SCM_EOL; + if (scm_is_pair (items)) return scm_stable_sort_x (scm_list_copy (items), less); else if (scm_is_vector (items))