From 6717160ebe0fe8f9891d3f0c164e7ee47b363bd4 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Mon, 18 Sep 2006 06:34:37 +0000 Subject: (svn r6475) - Fix (r6055): Don't try to sort industries when there are none. Thanks to 'Delboy' --- industry_gui.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/industry_gui.c b/industry_gui.c index 4b3a1a2c0..1671098be 100644 --- a/industry_gui.c +++ b/industry_gui.c @@ -556,6 +556,9 @@ static void MakeSortedIndustryList(void) const Industry* i; int n = 0; + /* Don't attempt a sort if there are no industries */ + if (GetIndustryArraySize() == 0) return; + /* Create array for sorting */ _industry_sort = realloc((void *)_industry_sort, GetIndustryArraySize() * sizeof(_industry_sort[0])); if (_industry_sort == NULL) -- cgit v1.2.3-70-g09d2