forked from 0ad/0ad
Add a missing check for undefined resource costs when picking the unit portrait in observermode. Patch by Imarok, fixes #4269.
This was SVN commit r18809.
This commit is contained in:
parent
bb438eca09
commit
3c72c16d6c
@ -897,7 +897,7 @@ function updateGroups()
|
||||
let getCostSum = (template) =>
|
||||
{
|
||||
let cost = GetTemplateData(template).cost;
|
||||
return Object.keys(cost).map(key => cost[key]).reduce((sum, cur) => sum + cur);
|
||||
return cost ? Object.keys(cost).map(key => cost[key]).reduce((sum, cur) => sum + cur) : 0;
|
||||
};
|
||||
|
||||
for (let i in Engine.GetGUIObjectByName("unitGroupPanel").children)
|
||||
|
Loading…
Reference in New Issue
Block a user