Search Issue Tracker
Won't Fix
Votes
0
Found in
2018.4
2019.4
2020.1
2020.2
2020.2.0a16
Issue ID
1258066
Regression
No
[Terrain] MissingReferenceException is thrown on exiting Prefab mode after opening Add tree window in Terrain
MissingReferenceException is thrown on exiting Prefab mode after opening Add tree window in Terrain and focusing on the Add tree window. Refer the attached video
Steps to reproduce:
1) Create a new project
2) GameObject > 3D Object > Terrain
3) Drag Terrain to Project folder and make a Prefab
4) Select Terrain in Project > Open Prefab
5) Paint trees > Edit trees > Add tree
6) Exit Prefab mode > Hover over Add tree window
Actual result: MissingReferenceException is thrown on exiting Prefab mode
Expected result: No errors should be thrown in console
Occurring in: 2020.2.0a16, 2020.1.0b14, 2019.4.2f1, 2018.4.20f1
Environment: Both Windows and Mac
Stack trace:
MissingReferenceException: The object of type 'Terrain' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEditor.TreeWizard.DrawWizardGUI () (at <96f7020efbd94777ae30ab44c007998b>:0)
UnityEditor.ScriptableWizard.OnGUI () (at <96f7020efbd94777ae30ab44c007998b>:0)
UnityEditor.HostView.OldOnGUI () (at <96f7020efbd94777ae30ab44c007998b>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <434515d9f4bb4f26bab9aa61f75e4922>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Resolution Note:
This use case is an extreme edge case in an uncommon workflow