Search Issue Tracker
Fixed
Fixed in 1.0.X - Entities
Votes
0
Found in [Package]
1.0.0
Issue ID
ECSB-315
Regression
No
Creating an empty ComponentTypeSet throws IndexOutOfRangeException
_Reported externally as [IN-40851|https://unity3d.atlassian.net/servicedesk/customer/portal/2/IN-40851]_ , and discussed on Slack [here|https://unity.slack.com/archives/CE7DZN2H1/p1683896584108499]
The following code throws an IndexOutOfRangeException:
{code:java}
namespace DefaultNamespace
{
public class Repro : MonoBehaviour
{
private void Awake()
{
var empty = new FixedList128Bytes<ComponentType>();
new ComponentTypeSet(empty);
}
}
} {code}
The issue is that ComponentTypeSet.CheckForDuplicates() assumes there is at least one element in the set. This is a bug; an empty ComponentTypeSet is pointless, but technically valid.
We should fix the bug in CheckForDuplicates(), but also add some tests to existing methods that take ComponentTypeSet and make sure they work correctly if the type set is empty. In most cases, the correct behavior would be to early-out ASAP.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Frame spike due to many TreeRenderer.TreeUpdated calls when repositioning terrains in large Scenes
- Crash on GameObject::RemoveComponentFromGameObjectInternal when reparenting Text GameObjects
- [IL2CPP-GarbageCollector] Changing GCMode might permanently disable GC in a multithreaded context
- Crash on invalid_parameter_internal when starting Standalone Profiler
- VFX Graph tooltips have a double line on the bottom side
Add comment