NullReferenceException but I can't find any errors?

Where’s my error in my coding? I have looked over this for a while and can’t find one. It’s giving me the error:
“NullReferenceException: Object reference not set to an instance of an object
AlienMovment.Update () (at Assets/Scripts/AlienMovment.js:42)”

Here’s the code for AlienMovment{

 if(transform.position.x > 25 || transform.position.x < -25){
    		//speed += .04;
    		speed *= -1.025;
    		for(var alien:GameObject in enemySettings.aliens){
    			alien.gameObject.transform.position.y -=1;
    		}
    	}

It’s giving me the error on the for loop.
Here’s the code for enemySettings{

function fillArray() {
	aliens = GameObject.FindGameObjectsWithTag("Alien");
	print(aliens.length);
}

function emptyArray(alien: GameObject) {
	var AlienMovement: AlienMovment = alien.gameObject.GetComponent("AlienMovment");
	print(AlienMovement.pointValue);
	Score.score += AlienMovement.pointValue;
	aliens.Clear();	
	Destroy(alien);		
	yield WaitForEndOfFrame;		 
	fillArray();
}

Also, it’ll print the error the first time, but not the second unless an alien is destroyed. Any and all help would be amazing.

You need to post the full script. Don’t know if this will help because I don’t have the full thing, but when your alien is destroyed, your script is still trying to reference it, when there isn’t one. Any lines that need to access an alien object need to only be called if the object exists. So for EXAMPLE, try encapsulating these lines in if(alien != null), OR if(aliens.Length > 0).

if(alien != null)
{
 var AlienMovement: AlienMovment =    alien.gameObject.GetComponent("AlienMovment");
    print(AlienMovement.pointValue);
    Score.score += AlienMovement.pointValue;
    aliens.Clear();    
    Destroy(alien);       
}

OR

if(aliens.Length > 0)
{
     var AlienMovement: AlienMovment = alien.gameObject.GetComponent("AlienMovment");
    print(AlienMovement.pointValue);
    Score.score += AlienMovement.pointValue;
    aliens.Clear();    
    Destroy(alien);       
}

And as I said, this is just an example. Try to implement this in your script. If it doesn’t work, post your FULL script that is having the issue.