get component variable from object in trigger

i want to get a component value from the game object which collides with my trigger’s object script.
this is my code on the trigger:

	void OnTriggerEnter (Collider obj){
		if(obj.GetComponent<motor>().enabled == true){
			passed = true;

and this is the error i get:

NullReferenceException: Object reference not set to an instance of an object
cp.OnTriggerEnter (UnityEngine.Collider obj) (at Assets/Scripts/cp.cs:15)

You need to check GetComponent is coming null or not.

 motor mObj = obj.gameObject.GetComponent<motor>();
  if(mObj != null)
       //code here

This may work for you.