From 190e149956abe33838abbc94edb7f8180f955e26 Mon Sep 17 00:00:00 2001 From: mob-sakai <12690315+mob-sakai@users.noreply.github.com> Date: Mon, 23 Dec 2024 12:51:57 +0900 Subject: [PATCH] fix: fix NRE --- Packages/src/Runtime/Internal/Utilities/ObjectPool.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Packages/src/Runtime/Internal/Utilities/ObjectPool.cs b/Packages/src/Runtime/Internal/Utilities/ObjectPool.cs index c74f74e..de33953 100644 --- a/Packages/src/Runtime/Internal/Utilities/ObjectPool.cs +++ b/Packages/src/Runtime/Internal/Utilities/ObjectPool.cs @@ -121,7 +121,11 @@ public static List Rent() /// public static void Return(ref List toRelease) { - UnityEngine.Pool.ListPool.Release(toRelease); + if (toRelease != null) + { + UnityEngine.Pool.ListPool.Release(toRelease); + } + toRelease = null; } #else