Search Unity

Bug NullReferenceException on Application Shut down.

Discussion in 'UGUI & TextMesh Pro' started by castor76, Jun 2, 2022.

  1. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    I sometimes get:

    NullReferenceException UnityEngine.Material.GetFloat (System.String name) (at <aebc378e78e24edcbc5cf48b180f8d66>:0)
    TMPro.TMP_SubMeshUI.UpdateMaterial () (at <049d1e5f79a3416bb5bfe5f262434e04>:0)
    TMPro.TMP_SubMeshUI.SetMaterialDirty () (at <049d1e5f79a3416bb5bfe5f262434e04>:0)
    UnityEngine.UI.MaskableGraphic.OnDisable () (at <a062ab9e7c5a4124927d489696cfbb62>:0)
    TMPro.TMP_SubMeshUI.OnDisable () (at <049d1e5f79a3416bb5bfe5f262434e04>:0)

    When I close the application. It seems to be harmless since the app is closing, but it leaves annoying error messages on the logs. (which players can read in my game)

    Any ideas?
     
    Menion-Leah likes this.
  2. Hosnkobf

    Hosnkobf

    Joined:
    Aug 23, 2016
    Posts:
    1,096
    This is is probably a bug report relevant for @Stephan_B.

    Can you provide more information? Do you know which label is responsible for the error? Is it a prefab or saved in the scene? Does it have a submesh child object outside of play mode?

    Do you call some code which changes text in a OnDestroy or OnDisable method?
     
  3. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    It's very difficult to get more info on this because it happens when Application Exits.. I mean after I call Application.Quit (I think) And it only seems to happen in the build.