Skip to content

Commit

Permalink
fix: fix NRE
Browse files Browse the repository at this point in the history
  • Loading branch information
mob-sakai committed Dec 23, 2024
1 parent 4a20d8e commit 190e149
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Packages/src/Runtime/Internal/Utilities/ObjectPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ public static List<T> Rent()
/// </summary>
public static void Return(ref List<T> toRelease)
{
UnityEngine.Pool.ListPool<T>.Release(toRelease);
if (toRelease != null)
{
UnityEngine.Pool.ListPool<T>.Release(toRelease);
}

toRelease = null;
}
#else
Expand Down

0 comments on commit 190e149

Please sign in to comment.