Instance (null) not found

I have a factory that spawn planets, but it only spawns a planet if my table that I’ve set in a module is not empty (positions), else if its empty, it is gameover. Sometimes I get this it’s gameover:

ERROR:SCRIPT: /states/controller/game_controller.script:37: Instance (null) not found

Line 37 in my game_controller script is:

local function delete_spawner(self)
   for index, value in ipairs(constants.spawner) do
      go.delete(value)
   end
end

My spawned gameobjects that was added to the constants.spawner table in my module only gets deleted if I don’t that error.

Do you remove things from this table or could it be that you are trying the delete the same thing twice?

Whenever a gameobject is spawned from my factory it add its url to the constants.spawner table and then whenever it is gameover then all the gameobjects from the constants.spawner table should be deleted.

I have a function in the gameobject’s script that gets spawned to delete itself after a while but then I think its URL will still remain in the constants.spawner table.