Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
moddedmcplayer committed Jun 18, 2022
1 parent 9a3267f commit 3843a6a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions hats/Hat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ public void DestroyInstances()
List<KeyValuePair<string, HatComponent>> toRemove = new List<KeyValuePair<string, HatComponent>>();
foreach (var kvp in Plugin.Singleton.hats.Where(x => x.Value.hat == this))
{
if (kvp.Value is null || kvp.Value.gameObject.Equals(null) || !kvp.Value.schem.isActiveAndEnabled)
{
toRemove.Add(kvp);
continue;
}
kvp.Value.DoDestroy();
toRemove.Add(kvp);
}
Expand Down

0 comments on commit 3843a6a

Please sign in to comment.