diff --git a/vector/v.external/list.c b/vector/v.external/list.c index 900aede55ab..6c94ea69deb 100644 --- a/vector/v.external/list.c +++ b/vector/v.external/list.c @@ -64,7 +64,8 @@ char **format_list(int *count, size_t *len) } /* order formats by name */ - qsort(list, *count, sizeof(char *), cmp); + if (list) + qsort(list, *count, sizeof(char *), cmp); #endif #if defined HAVE_POSTGRES && !defined HAVE_OGR list = G_realloc(list, ((*count) + 1) * sizeof(char *));