Skip to content

Commit

Permalink
Prevent inspector crashes when inspected object was destroyed
Browse files Browse the repository at this point in the history
  • Loading branch information
ManlyMarco committed Dec 1, 2018
1 parent 1070912 commit e8c72d4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CheatTools/Inspector/Inspector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,12 @@ public void DisplayInspector()

if (Event.current.keyCode == KeyCode.Return) _userHasHitReturn = true;

while (_inspectorStack.Count > 0 && _inspectorStack.Peek().Instance == null)
{
var se = _inspectorStack.Pop();
Logger.Log(LogLevel.Message, $"[Cheat Tools] Inspected object \"{se.Name}\" has been destroyed");
}

if (_inspectorStack.Count != 0)
{
Utilities.DrawSolidWindowBackground(_inspectorWindowRect);
Expand Down

0 comments on commit e8c72d4

Please sign in to comment.