How to destroy an instantiated prefab object and keep instantiating it

Hello, I’m woking on a game similar to Temple Run and I’m spawning (instantiating prefabs) all the platforms randomly to create the way for the run. After the player has passed a platform I need to destroy that platform but I don’t know how to do it…
I tryed putting a box collider over the platform and attach to the platform a script with a OnTriggerExit void to destroy the platform when the player exit the trigger… but then I get an error that says:

MissingReferenceException: The object of type ‘GameObject’ has been destroyed but you are still trying to access it. Your script should either check if it is null or you should not destroy the object.

I searched a lot in the forum and with Google for a solution but I didn’t find anything… any help would be highly appreciated.
Thanks

Are you using a List to store the Platforms? If so, you might be deleting the gameobject, but not removing it from the list, and the list is still trying to access it somehow