[Solved in v1.16.15] AssetReferenceDrawer error with SpriteAtlas (v1.16.13)

Hello,

After updating to v1.16.13 (1.16.12 as well), there are errors from AssetReference assigned to a atlas with a sprite (sub asset).

Here are the outputs:

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.AddressableAssets.GUI.AssetReferenceDrawer.DrawSubAssetsControl (UnityEditor.SerializedProperty property, System.Collections.Generic.List`1[T] subAssets) (at Library/PackageCache/com.unity.addressables@1.16.13/Editor/GUI/AssetReferenceDrawer.cs:489)
UnityEditor.AddressableAssets.GUI.AssetReferenceDrawer.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at Library/PackageCache/com.unity.addressables@1.16.13/Editor/GUI/AssetReferenceDrawer.cs:278)
UnityEditor.PropertyDrawer.OnGUISafe (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at <a8e33794c0064f2aa201ade069162226>:0)
UnityEditor.PropertyHandler.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.Rect visibleArea) (at <a8e33794c0064f2aa201ade069162226>:0)
UnityEditor.GenericInspector.OnOptimizedInspectorGUI (UnityEngine.Rect contentRect) (at <a8e33794c0064f2aa201ade069162226>:0)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <a8e33794c0064f2aa201ade069162226>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

It’s caused by the null m_AssetRefObject.SubOjbectType.
So I took a look at AssetReference.SetEditorSubObject, and found that in case of a SpriteAtlas m_SubObjectType is never assigned.
It looks like a bug for me. Any idea about this? Thanks.

I believe the team is aware of this. If you haven’t yet, could you go ahead and submit a bug report for us?

Hi TreyK-47,

I’ve checked this issue with v1.16.15 and found that it’s been solved.
Thanks a lot for your helps.

1 Like

There was a lil’ sneaky change where 1.16.13 was marked as verified so I updated to that and then today when we discovered this bug it turns out 1.16.13 is no longer marked as verified and 1.16.15 is… lol

But at least it is fixed so thank you.