how to make a particle emitter to only emit when boosting

In my spaceship game, the players spaceship has a boolean variable for whether or no the ship is boosting. if that variable is true, the particle emitter on the ship’s engines sets its variable particleEmitter.emit to true or false accordingly.
But whenever particleEmitter.emit is set to false, the gameObject deletes it’s self.

function Update () 
{
	if ((GameObject.FindWithTag("Player").GetComponent(ShipControl) as ShipControl).boosting)
		particleEmitter.emit = true;
	else
		particleEmitter.emit = false;
}

Do you have the ‘autodestruct’ field of the ParticleAnimator component checked?

Edit: Also, that code can be written more concisely as:

particleEmitter.emit = (GameObject.FindWithTag("Player").GetComponent(
    ShipControl) as ShipControl).boosting

yes, that is exactly what the problem was. thanks