Search Issue Tracker
Fixed in 1.5.0-preview.12, 2.1.0-preview.12, 3.0.0-preview.12
Votes
0
Found in [Package]
3.0.0
Issue ID
1245104
Regression
No
[TMP] NullReferenceException error is thrown on assigning Font Atlas texture to None
NullReferenceException error is thrown on assigning Font Atlas texture to None.
Steps to repro:
1. Create a new Project.
2. Windows > Package Manager > TextMeshPro(3.00-preview.11) > Update.
3. GameObject > 3D Object > Text - TextMeshPro.
4. Debug Settings > Font Atlas > Select texture to None.
Actual Result:
NullReferenceException error is thrown in the console.
Expected Result:
No error in the console.
Reproducible in:
2020.2.0a11, 2020.1.0b8, 2019.3.0f3.
Tested on TMP Package Version: 3.0.0-preview.11, 3.0.0-preview.1.
Environment:
Occurring on Windows 10 & Mac 10.15.
Stacktrace:
NullReferenceException: Object reference not set to an instance of an object
TMPro.TextMeshPro.ON_MATERIAL_PROPERTY_CHANGED (System.Boolean isChanged, UnityEngine.Material mat) (at library/packagecache/com.unity.textmeshpro@3.0.0-preview.11/scripts/runtime/tmpro_private.cs:335)
TMPro.FastAction`2[A,B].Call (A a, B b) (at library/packagecache/com.unity.textmeshpro@3.0.0-preview.11/scripts/runtime/fastaction.cs:109)
TMPro.TMPro_EventManager.ON_MATERIAL_PROPERTY_CHANGED (System.Boolean isChanged, UnityEngine.Material mat) (at library/packagecache/com.unity.textmeshpro@3.0.0-preview.11/scripts/runtime/tmpro_eventmanager.cs:57)
TMPro.EditorUtilities.TMP_BaseShaderGUI.OnGUI (UnityEditor.MaterialEditor materialEditor, UnityEditor.MaterialProperty[] properties) (at library/packagecache/com.unity.textmeshpro@3.0.0-preview.11/scripts/editor/tmp_baseshadergui.cs:166)
UnityEditor.MaterialEditor.PropertiesGUI () (at <89a088b11b1f446fb543c196a8473632>:0)
UnityEditor.MaterialEditor.OnInspectorGUI () (at <89a088b11b1f446fb543c196a8473632>:0)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <89a088b11b1f446fb543c196a8473632>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
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
- Objects with Universal Render Pipeline/Particles/Lit shader are always lit up when changing their Rendering Layer Mask
- PolySpatial “Trying to set shader on a Material Variant.” error is printed in the console when entering Play Mode
- Error “Shader error in 'YSCloudCover': call to 'tex3D' is ambiguous at Assets/YSCloudCoverText.shader(606) (on d3d11)“ is present when compiling tex3D shader with DXC
- Placeholder asset is not loaded with Advertisement Legacy sample when using the latest version of the package
- Addressables content build fails but the Player build is successful when building a development build
Resolution Note (fix version 1.5.0-preview.12, 2.1.0-preview.12, 3.0.0-preview.12):
setting the atlas texture of a text object to None or Null will result in the text rendering as white blocks. Although the NullReferenceException will no longer occur, it is not advisable to set the atlas texture of a text object to None / Null.
The fix for the behavior will be included in the next release of the TMP package which is expected to be Preview 12.