Search Issue Tracker
Won't Fix
Votes
0
Found in
2019.2
2019.4.6f1
2020.2
Issue ID
1266200
Regression
Yes
NullReferenceException is thrown when using EditorStyles.wordWrappedLabel inside a ToggleGroup
How to reproduce:
1. Open the project "WordWrappedLabel.zip"
2. Go to Window -> My Window and dock it somewhere
3. In the Project window open Editor/TestEditorScript.cs
4. In the TestEditorScript.cs comment out EditorGUILayout.EndToggleGroup(); line and save it
5. Focus the Editor and observe the error in the Console
6. Uncomment the same line and focus the Editor
Expected result: the error is no longer thrown once the line is uncommented
Actual result: the error remains in the Console
Reproducible with: 2019.2.0a1, 2019.2.21f1, 2019.3.16f1, 2019.4.6f1, 2020.1.0f1, 2020.2.0a19
Could not test with: 2018.4.26f1, 2019.1.0a14, 2019.1.14f1
Notes:
1. Full error:
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.EditorStyles.get_wordWrappedLabel () (at /Users/builduser/buildslave/unity/build/Editor/Mono/GUI/EditorStyles.cs:41)
TestEditorScript..ctor () (at Assets/Editor/TestEditorScript.cs:6)
2. Versions 2018.4.26f1, 2019.1.14f1 do not throw any NullReferenceExceptions (when the line is commented and when the line is uncommented)
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
- var VisionOSEDRHeadromm has a comma instead of a dot when building with Metal Rendering App Mode and local OS localization is set to German
- IAP Catalog remove product “x” and add product “+” buttons are not consistent with other remove and add buttons in the Editor
- Performance issues in Play Mode when quickly hovering the mouse cursor over Hierarchy GameObjects
- Frame Debugger displays incorrect output when FidelityFX Super Resolution or Spatial-Temporal Upscaler is used with Temporal Anti-aliasing or Subpixel Morphological Anti-aliasing
- The layout system is failing to correctly calculate or apply the height of the Japanese fallback font when the primary English font's metrics are used
Resolution Note (2020.2.X):
The core issue here is of trying to access the styles when the domain reload is in progress. At this stage, the style catalog is not available and hence the null reference exceptions. Unfortunately, the design cannot be altered at this point, to make the styles available during a domain reload. Hence we will not be able to fix this
Also refer to case 1231054 which deals with the same problem