Object reference not set to an instance of an object

Hi, so I have a script that makes it so that the hands attached to the gun model are not visible when you are not holding it. I have both variables assigned but when I run the game I get the runtime error shown above. Here is my script.

var walkScript: PlayerMovementScript;
var parentGun: GameObject;


function Start () 
{
	walkScript = GameObject.FindWithTag("Player").GetComponent(PlayerMovementScript);

}

function Update () 
{
	if(walkScript.currentGun == parentGun)
	{
		gameObject.GetComponent(MeshRenderer).enabled = true;
	}
	if(walkScript.currentGun != parentGun)
	{
		gameObject.GetComponent(MeshRenderer).enabled = false;
	}
}

Thanks!

Ok guys, figured it out. One of the hands was SkinnedMeshRenderer, the other was MeshRenderer, since it was not animated. Fixed it with this:

var walkScript: PlayerMovementScript;
var parentGun: GameObject;


function Start () 
{
	walkScript = GameObject.FindWithTag("Player").GetComponent(PlayerMovementScript);

}

function Update () 
{
	if(walkScript.currentGun == parentGun)
	{
		if(gameObject.GetComponent(SkinnedMeshRenderer))
		{
			gameObject.GetComponent(SkinnedMeshRenderer).enabled = true;
		}
		else
		{
			gameObject.GetComponent(MeshRenderer).enabled = true;

		}
	}	
	if(walkScript.currentGun != parentGun)
	{
		if(gameObject.GetComponent(SkinnedMeshRenderer))
		{
			gameObject.GetComponent(SkinnedMeshRenderer).enabled = false;
		}
		else
		{
			gameObject.GetComponent(MeshRenderer).enabled = false;

		}
	}
}

Thanks guys!