That sounds like a bug in the pooling code. If it’s not your code then review the API because perhaps you misused it.
The answer is always the same… ALWAYS!
How to fix a NullReferenceException error
Three steps to success:
- Identify what is null ← any other action taken before this step is WASTED TIME
- Identify why it is null
- Fix that
NullReference is the single most common error while programming. Fixing it is always the same.
Some notes on how to fix a NullReferenceException error in Unity3D:
IF YOU STILL WANT TO USE POOLING:
The costs and issues associated with object pooling / pools:
In very rare extremely-high-count object circumstances I have seen small benefits from pooling.
In MOST circumstances, object pooling is a source of complexity, bugs and edge cases while not giving any measurable benefit.