Search Issue Tracker

Active

Under Consideration for 6000.6.X

Votes

0

Found in

6000.6.0a2

Issue ID

UUM-137979

Regression

No

Renaming issues when clicking a selected node and immediately deleting it.

Hierarchy V2

-

There are two issues that can happen when deleting a node that is in the process of entering its rename mode:

  1. Rename starts on another item, possibly where the HierarchyViewItem is recycled.
  2. There are errors thrown in the console if there is no other node that reuse this HierarchyViewItem.

Steps to reproduce:

  1. Create an empty scene.
  2. Add two game objects.
  3. Select the first one.
  4. Click it again and delete it before the renaming process starts. Renaming will start on the other game object.
  5. Cancel rename and select the remaining game object. If a rename starts, cancel it.
  6. Click it again and delete it before the renaming process starts.
  7. Errors are logged in the console, with the following callstack: 

{noformat}
NullReferenceException: Object reference not set to an instance of an object
Unity.Hierarchy.Editor.HierarchyGameObjectHandler.Unity.Hierarchy.IHierarchyEditorNodeTypeHandler.CanSetName (Unity.Hierarchy.HierarchyView view, Unity.Hierarchy.HierarchyNode& node) (at D:/UnitySrc/u/u3/Modules/HierarchyEditor/ScriptBindings/HierarchyGameObjectHandler.bindings.cs:206)
Unity.Hierarchy.HierarchyViewItem.BeginRename () (at D:/UnitySrc/u/u3/Modules/Hierarchy/Managed/HierarchyViewItem.cs:305)
Unity.Hierarchy.HierarchyView+<>c__DisplayClass174_0.<OnClickEvent>b__0 () (at D:/UnitySrc/u/u3/Modules/Hierarchy/Managed/HierarchyView.cs:1500)
UnityEngine.UIElements.VisualElement+SimpleScheduledItem.PerformTimerUpdate (UnityEngine.UIElements.TimerState state) (at D:/UnitySrc/u/u3/Modules/UIElements/Core/VisualElementScheduler.cs:385)
UnityEngine.UIElements.TimerEventScheduler.UpdateScheduledEvents () (at D:/UnitySrc/u/u3/Modules/UIElements/Core/Scheduler.cs:386)
UnityEngine.UIElements.Panel.TickSchedulingUpdaters () (at D:/UnitySrc/u/u3/Modules/UIElements/Core/Panel.cs:1523)
UnityEngine.UIElements.UIElementsUtility.UpdateSchedulers () (at D:/UnitySrc/u/u3/Modules/UIElements/Core/UIElementsUtility.cs:179)
UnityEditor.RetainedMode.UpdateSchedulers () (at D:/UnitySrc/u/u3/Modules/UIElementsEditor/RetainedMode.cs:44)
UnityEngine.StackTraceUtility:ExtractStringFromExceptionInternal(Object, String&, String&) (at D:/UnitySrc/u/u3/Runtime/Export/Scripting/StackTrace.cs:50)
{noformat}

Actual results: 

For scenario 1: renaming starts on another node.

For scenario 2: errors are thrown in the console.

Expected results: 

For scenario 1: no renaming is started.

For scenario 2: no errors are thrown.

Reproducible with versions: 6000.6.0a2

Not reproducible with versions: 

Can’t test with versions: 

Tested on (OS): Windows 11.

Notes:

  •  

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.