diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp index 3a4c0cb448..f09a571fc3 100644 --- a/src/newgrf_config.cpp +++ b/src/newgrf_config.cpp @@ -406,6 +406,7 @@ void ScanNewGRFFiles() } DEBUG(grf, 1, "Scan complete, found %d files", num); + if (num == 0 || _all_grfs == NULL) return; /* Sort the linked list using quicksort. * For that we first have to make an array, the qsort and