This is the line that throws the exception, so this doesn't fix #4134 as it currently stands.
You need to add the IsDead/IsDestroyed check in the code that spawns this effect.