Search Issue Tracker
Not Reproducible
Votes
0
Found in
5.3.4f1
Issue ID
783176
Regression
No
Serialized dictionary Is Throwing Index Out of Range error on 13th item
Steps to reproduce:
1. Download and open attached project " SerializeDictionaryError.zip"
2. Open and play scene "Battle"
3. Notice the error
4. Open "Helmets.csv" file located at Assets/Resources/ExcelData
5. Change it so it only has 12 items in it (deleting one random line works) and save it
6. Select object "Database" in hierarchy and press "Update Database" button in top most script component
7. Play scene again and notice that error is gone
Actual result: Error is thrown if serialized dictionary has more than 12 elements
Expected result: No error
Note: User outlines that error is caused by "foreach(KeyValuePair<TKey,TValue> pair in this)" line
Tested and reproduced on:
Windows 10
Unity 5.1.4f1, 5.2.4p1, 5.3.4p1, 5.4.0b12
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
- The dithering node returns a blocky effect when the Render Scale is set to some values below 1
- [Android Module] Unity double writes files in the "StreamingAssets" folder when they are deleted using "IPostGenerateGradleAndroidProject" after the Grandle project is generated
- IndexOutOfRangeException and InvalidOperationException when clicking on the HTML log in the Console
- Warnings "Attempting to draw with missing bindings" are logged when opening the HDRP VFX Template Sample Scene
- Red spots appear when Blending Lighting Scenarios using Adaptive Probe Volumes
faviann
Apr 20, 2016 19:40
For people wondering how this issue is caused (concurrency problem mainly), have a look at: http://forum.unity3d.com/threads/iserializationcallbackreceiver-throwing-exceptions.329917/#post-2167896
Nice explanation covering how encapsulation is needed to serialize the dictionary instead of a inheritance.