Search Issue Tracker
Won't Fix
Votes
0
Found in
5.5.0a4
Issue ID
816355
Regression
No
NullReferenceException if Undo.RevertAllInCurrentGroup() is used in OnSceneGUI
Steps to reproduce:
1. Open my attached project "case_816355Test".
2. Enter play mode.
3. Exit play mode.
---In the console window "NullReferenceException" message appears.
Expected results: Script "SomeStaticClass" should create new game object, rename it and Undo.RevertAllInCurrentGroup() should revert him to original state (in this case reverting his name).
Actual results: Script "SomeStaticClass" doesn't even create new object so there is not even a chance to rename it and use Undo function to revert changes. Deleting
Undo.RevertAllInCurrentGroup() function in "SomeStaticClass" at least creates new object and renames it.
--- Side note: "UndoExample" script, which can be found in project menu, implements almost the same behavior as "SomeStaticClass" but not in "OnSceneGUI" method. This lets Undo.RevertAllInCurrentGroup() reverse the state of the object (in this script it just changes his name to the original).
Reproduced with: 5.5.0a6, 5.4.0p2, 5.3.5f1, 5.2.0f3
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- [Search] Query Builder - uneditable NaN in Transform vectors
- Transform.rotation property is as a Vector4 Quaternion instead of a Vector3 field when using InspectorElement.FillDefaultInspector
- [Search] Query Builder - "Input String was not in a correct format" error when changing query options
- MacOS Xcode project build fails when a package has PrivacyManifest
- [IL2CPP] Crash when closing the Player while an exception is thrown during exception handling
Add comment