# HG changeset patch # User peter1138 # Date 2006-09-18 06:34:37 # Node ID 408a5195583fa309f2d6e27acdbd11249738b249 # Parent 6c3e63bd2e31f6b13e2a0292cbc457d4fdf3736d (svn r6475) - Fix (r6055): Don't try to sort industries when there are none. Thanks to 'Delboy' diff --git a/industry_gui.c b/industry_gui.c --- 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)