- if (isNaN(p.x) || p.x === null || p.x === undefined) return false;
- if (isNaN(p.y) || p.y === null || p.y === undefined) return false;
+ if (p.yval === null) return false; // missing point
+ if (p.x === null || p.x === undefined) return false;
+ if (p.y === null || p.y === undefined) return false;
+ if (isNaN(p.x) || (!allowNaNY && isNaN(p.y))) return false;