Fixed small bug

When:

var t = nDotC / nDotD;

if (t < 0.0) {
   return null;
}

the position can't be calculated, because "null" has no property "left" and "top", also the marker is out of sighs and don't have to be calculated.
Small cosmetic to match rest of the code.