Getting the error "ullReferenceException: Object reference not set to an instance of an object PlayerCasting.Update () (at Assets/Scripts/PlayerCasting.js:7) on my JavaScript raycasting script

I was trying to make a player raycasting script in JavaScript and I got the following error,

NullReferenceException: Object reference not set to an instance of an object
PlayerCasting.Update () (at Assets/Scripts/PlayerCasting.js:7)

I cannot find any errors in my script (I am new to Unity and Coding in general) so it would be great if someone could help me resolve this error. Below is my script.

(/Saved Pictures/Capture.jpg “My Code”

Never mind, I fixed the error. It was a spelling error.