GetMultipleEntityStates can return null, but null can't be frozen. As reported by temple, this throws an error in some situations (presumably when having an entity selected that got destroyed).
Could just make that g_EntityStates[item.entId] = item.state && deepfreeze(item.state);
The code in Imaroks multi-selection patch primarily uses entStates.some.
So if 200 units are selected and and all loops abort after the first some iteration,
the 199 other entity states were not be used in that code part.
Whether this scenario is actually occuring depends on the entity templates and the most recent fancy multi-selection GUI features.
Just wanted to say that the GetEntityState function will always remain subject to optimization and revision as long as it's low performant.
(It would be nice if the tooltip functions could specify themselves which info they will need and then acquire exactly the used properties in the GUI interface)
These used to be in the regular interface rather than miraged, so now when selecting we get:
ERROR: JavaScript error: simulation/components/GuiInterface.js line 363
TypeError: cmpFoundation.GetBuildRate is not a function
GuiInterface.prototype.GetEntityState@simulation/components/GuiInterface.js:363:19