# HG changeset patch # User peter1138 # Date 1158561277 0 # Node ID 27e2588a5eff010b86fc98565470b6c3c0ba9cc2 # Parent 3c22e5eb5ffe9190889aca1d18fc26cb9eda8fd7 (svn r6475) - Fix (r6055): Don't try to sort industries when there are none. Thanks to 'Delboy' diff -r 3c22e5eb5ffe -r 27e2588a5eff industry_gui.c --- a/industry_gui.c Sun Sep 17 20:52:54 2006 +0000 +++ b/industry_gui.c Mon Sep 18 06:34:37 2006 +0000 @@ -556,6 +556,9 @@ 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)