Search Issue Tracker

Fixed in 1.5.0-preview.12, 2.1.0-preview.12, 3.0.0-preview.12



Found in [Package]


Issue ID




[TMP] NullReferenceException error is thrown on assigning Font Atlas texture to None

Package: TextMeshPro


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.

Occurring on Windows 10 & Mac 10.15.

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&)

  1. 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.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.