Add some robustness against broken data

This was SVN commit r7505.
This commit is contained in:
Ykkrosh
2010-05-07 15:56:24 +00:00
parent d0599f4c7a
commit e73a3cff78
@@ -134,6 +134,8 @@ function setupUnitPanel(guiName, usedPanels, unitEntState, items, callback)
var icon = getGUIObjectByName("unit"+guiName+"Icon["+i+"]");
var template = Engine.GuiInterfaceCall("GetTemplateData", entType);
if (!template)
continue; // ignore attempts to use invalid templates (an error should have been reported already)
var name;
if (template.name.specific && template.name.generic)