Skip to content

Commit

Permalink
fix: exception occur when registry key object is null
Browse files Browse the repository at this point in the history
  • Loading branch information
ReinaS-64892 authored and bdunderscore committed Aug 29, 2024
1 parent e2d5dab commit 6ea0f74
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Editor/API/ObjectRegistry.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#region
#region

using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -125,7 +125,7 @@ internal string RegistryDump()
foreach (var group in _obj2ref.GroupBy(kvp => kvp.Value))
{
var source = group.Key.Object == null ? "<null>" : group.Key.Object.name;
var instances = group.Select(kvp => kvp.Key.GetInstanceID() + " [" + kvp.Key.name + "]").ToArray();
var instances = group.Select(kvp => kvp.Key != null ? kvp.Key.GetInstanceID() + " [" + kvp.Key.name + "]" : "Destroyed [Unknown]").ToArray();

sb.Append("\tGroup source ").Append(source).Append(": ").Append(string.Join(", ", instances))
.Append("\n");
Expand Down

0 comments on commit 6ea0f74

Please sign in to comment.