Search Issue Tracker
Fixed in 2021.2.X
Fixed in 2020.3.X, 2021.1.X
Votes
1
Found in
2019.4
2020.2
2020.2.0b13
2021.1
2021.2
Issue ID
1303188
Regression
No
Multiple errors appear after modifying ScriptableObject's array indirectly
How to reproduce it:
1. Open the attached project '1303188.zip'
2. Select "New IMGUI Drawer Test.asset"
3. Set the Objects With IMGUI Drawers > Size value to 5
4. Press CTRL + Z (Undo)
5. Observe the Console Window
Expected result: The error doesn't appear in the Console Window
Actual result: The error appears "Retrieving array element that was out of bounds" in the Console Window
Reproducible with: 2019.4.17f1, 2020.2.2f1, 2021.1.0b2, 2021.2.0a2
Could not test with: 2018.4.30f1 (UIElements are not introduced)
Notes:
- Errors appear after adding/removing an item programmatically in the ScriptableObject's array
- Not reproducible after modifying ScriptableObject's array by changing Property Fields values in the Inspector view
-
oscarAbraham
Jan 13, 2021 20:17
Hello, thanks for taking a look at this issue.
I wanted to point out that this errors appear in many more cases other than "after undoing the increase of the Serializable array's size". That case was just the easiest example I could think of. The errors are triggered anytime that a property becomes invalid and an IMGUI property drawer is used inside a UIToolkit's PropertyField. That could happen by destroying an object, by changing a managed reference's type, by calling Dispose on a serialized object, etc. It can even happen when reducing an array's size in any place other than directly in the property field.
I really hope the mechanism behind this bug is not lost in thinking it's just a problem with undoing an array's growth.
Also, I checked the C# reference in Github. I believe this could be fixed by simply putting "if (!m_SerializedProperty.isValid) return;" in line 104 of PropertyField.cs
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
- Search: Inspector section icon is less sharp/more pixelated than other editor icons
- Search description string is always truncated
- [VFX] When Grouped Nodes are converted to Subgraph Operator resulting Graph Node is not included in the Group
- Search window icons are less sharp/more pixelated than other editor icons
- The Inspector can be covered when scaling the horizontal separator bar
Resolution Note (fix version 2021.2):
Fixed in 2021.2.0a9
Resolution Note (fix version 2021.1):
Fixed in 2021.1.4f1
Resolution Note (fix version 2020.3):
Fixed in 2020.3.8f1