Help with DrawLine class

I found DrawLine class in Unity Wiki.

But I’m having error whenever I call the function.
Basically I pass in Start Point and an End Point then I got this error:

“NullReferenceException” on this line of code

GUIUtility.ScaleAroundPivot(new Vector2((pointB - pointA).magnitude, width), 
new Vector2(pointA.x, pointA.y + 0.5f));

More specifically the error should like this:
“NullReferenceException: Object reference not set to an instance of an object
UnityEngine.GUI.set_matrix (Matrix4x4 value)”

Anyone know how to solve this?

Can you provide the complete code related to what you are trying to do (at OnGUI)?
It seems that PointB and/or PointA aren’t defined at the moment you are going through this line in your code.