yasirkula / UnityRuntimeInspector

Runtime Inspector and Hierarchy solution for Unity for debugging and runtime editing purposes
MIT License
1.68k stars 135 forks source link

Error when deleting object shown by search #47

Closed i-xt closed 2 years ago

i-xt commented 2 years ago

Description of the bug

When a GameObject that is visible in the hierarchy is destroyed while in search mode, a NullReferenceException is thrown.

Reproduction steps

  1. Type something in the search bar, so that at least one entry is displayed in the hierarchy
  2. Delete one of the displayed GameObjects from Unity's hierarchy (or by any other means)

Platform specs

Additional info

NullReferenceException is thrown here

https://github.com/yasirkula/UnityRuntimeInspector/blob/d1e02a3f5d92ebb928069a6d6852c7daaea3079f/Plugins/RuntimeInspector/Scripts/RuntimeHierarchy/HierarchyDataRootScene.cs#L31