Possible bug in TMPro_UGUI_Private with m_subTextObjects sizing

I’ve been receiving an IndexOutOfRange exception in the following code in Awake() in the TMPro class from the title:

            TMP_SubMeshUI[] subTextObjects = GetComponentsInChildren<TMP_SubMeshUI>();
            if (subTextObjects.Length > 0)
            {
                for (int i = 0; i < subTextObjects.Length; i++)
                    m_subTextObjects[i + 1] = subTextObjects[i];
            }

It’s around line 137 in v2.0.1.

The problem is that m_subTextObjects is declared as:

        protected TMP_SubMeshUI[] m_subTextObjects = new TMP_SubMeshUI[8];

but the size of subTextObjects is 8, so it ALWAYS overflows the array.

“Fixing” it by declaring m_subTextObjects to hold 9 elements works, but I don’t know why this off-by-one is there in the first place.

I recently revised this to make sure the above error will no longer occur and that more than 8 sub text objects can also be supported. This change will be included in the next release of the TMP package which I expect to release sometime this week.

Thanks!