How to reproduce:
1. Create a new Project
2. Create a new Empty GameObject
3. Make it a Prefab
4. Create a Second Empty GameObject
5. Make it a Prefab
6. Combine two Prefabs to make a nested Prefab
7. Apply Override
8. Open Child Prefab of the Nested Prefab in Prefab Mode
9. Attach all TMPro Scripts via Add Component > Scripts > TMPro
10. Exit Prefab mode and when prompted Save your changes
11. Press Undo Command Several Times
Expected results: Undo command does not crash the Editor
Actual results: Unity Editor crashes
Reproducible with: 2019.4.40f1, 2020.3.36f1, 2021.3.3f1, 2022.1.3f1
Not reproducible with: 2022.2.0a16
First lines of Stack Trace:
#0 0x00000100dbcf44 in GameObject::ActivateAwakeRecursivelyInternal(DeactivateOperation, AwakeFromLoadQueue&)
#1 0x00000100dbd07e in GameObject::ActivateAwakeRecursivelyInternal(DeactivateOperation, AwakeFromLoadQueue&)
#2 0x00000100dbcc4e in GameObject::ActivateAwakeRecursively(DeactivateOperation)
#3 0x000001014c611d in AwakeFromLoadQueue::InvokeAwakeFromLoad(AwakeFromLoadQueue::Item*, unsigned int, AwakeFromLoadMode)
#4 0x000001014c5ebe in AwakeFromLoadQueue::AwakeFromLoadAllQueues(AwakeFromLoadMode, bool)
#5 0x00000101fc2e4e in ObjectUndo::Restore(bool)
#6 0x00000101fc68a5 in UndoManager::Apply(std::__1::list<UndoBase*, stl_allocator<UndoBase*, (MemLabelIdentifier)122, 16> >&, bool)
#7 0x00000101fc6dd7 in UndoManager::Undo()
Notes:
- In 2021 Unity version no Stack Trace is printed when crash happens