diff --git a/src/path/Curve.js b/src/path/Curve.js index 8a66c914..099d706a 100644 --- a/src/path/Curve.js +++ b/src/path/Curve.js @@ -1122,7 +1122,7 @@ statics: /** @lends Curve */{ */ getNearestPoint: function(/* point */) { var loc = this.getNearestLocation.apply(this, arguments); - return loc ? loc.getPoint() : loc; + return loc ? loc.getPoint() : loc; } /** diff --git a/src/path/PathItem.js b/src/path/PathItem.js index 509e6278..e8c84beb 100644 --- a/src/path/PathItem.js +++ b/src/path/PathItem.js @@ -374,7 +374,8 @@ var PathItem = Item.extend(/** @lends PathItem# */{ * } */ getNearestPoint: function(/* point */) { - return this.getNearestLocation.apply(this, arguments).getPoint(); + var loc = this.getNearestLocation.apply(this, arguments); + return loc ? loc.getPoint() : loc; }, /**