Search Issue Tracker
Fix In Review for 2022.1.X
Votes
0
Found in
2022.1
2022.1.0b2
2022.2
Issue ID
1392262
Regression
No
ArgumentOutOfRangeException error is thrown when element is deleted in the PropertyDrawer ListView
Reproduction steps:
1. Open the user's project
2. Select "New List View Container.asset" in the Assets folder
3. Press the '+' button in the Properties list to add a new ItemProperty
4. Choose one of the proposed options to add
5. Press the '-' button in the Properties list to remove an ItemProperty
Expected result: The selected element is deleted without any errors
Actual result: The selected element sometimes (about 1/3 times) is not deleted and errors are thrown: \
1st error - "ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection."
2nd error - "SerializedProperty _item._properties.Array.data[X] has disappeared! UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)"
Reproducible with: 2022.1.0b11, 2022.2.0a7
Could not test with: 2019.4.36f1, 2020.3.30f1, 2021.2.15f1(2019.4, 2020.3 - "Assets/Scripts/Editor/CustomControl/CustomDropDown.cs(30,37): error CS8124: Tuple must contain at least two elements."; 2021.2 - "Assets/Scripts/Editor/ListViewExample/InventoryItemPropertyDrawer.cs(123,51): error CS1061: 'SerializedProperty' does not contain a definition for 'boxedValue' and no accessible extension method 'boxedValue' accepting a first argument of type 'SerializedProperty'")
Notes:
- If an element wasn't deleted, only the 1st error appears
- Reproducible on both Windows 10 and macOS
Comments (1)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Frame Debugger is not disabled when switching Scenes if the Frame Debugger window is not open during the transition
- Standalone Profiler Targets another Project if a Standalone Profiler was launched in it before when switching between Edit or Play Mode Targets
- Crash on ForwardRenderLoopJob when opening a specific project
- [Android] Memory leak and eventual crash on Snapdragon 8 Gen 1+ devices when a Clear Pass is executed after Framebuffer Fetch
- PhysicsRaycaster ray length is incorrect when casting from rotated Camera
emptybraces
Apr 05, 2022 17:38
2nd error is 100% occured on my project.(version 2021.2.13f )
Called from UnityEditor.RetainedMode:UpdateSchedulers () will be used the changed list, no problem.
However, the one called from UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) uses the unchanged list and an error occurs.
Workaround at me:
int removed_idx = -1;
listview.bindItem = (VisualElement element, int index) =>
{
if (removed_idx == index)
{
removed_idx = -1;
return;
}
....
};
listview.itemsRemoved += e =>
{
removed_idx = e.First();
};