Yet another door open issue with Rays/C#

(I have tried to attach screenshots to give a best view of my setup)

I have a ray attached to an empty object in front of the door, green line projected out, turns red when crossed and even tells me in console.
When I press E to open door, it gives me:
NullReferenceException: Object reference not set to an instance of an object
ray_test.Update () (at Assets/Scripts/ray_test.cs:17)

I have looked and there are many with this issue but I just don’t see my problem. (New to scripting, like 2 weeks new!)
So I have an empty door object(parent) with box collider attached to my door graphic(child)
ray_test.cs


door.cs:
2359412--160033--upload_2015-10-28_20-38-20.png
2359412--160034--upload_2015-10-28_20-40-8.png

2359412--160035--upload_2015-10-28_20-40-41.png

d = rayhit.transform.root.GetComponent();
this is returning null.

Is the script on the root object?
Is the object the ray returning even the door object?

I would suspect that it isn’t even the door object that is being returned from the raycast, but the object that the ray is originating from. Raycast is a static function that is doesn’t care about which objects it should test against or ignore unless you tell it.

After the raycast check the name or tag of the object being returned. You may need to setup laymasking for the ray to only get the door.

Thanks!
Went a slightly different way with it but I did have the relationships mixed up.
I have the ray from the main camera and the collider on the door so it is all figured out.
Thanks!