From 9d8bf12028c9a5c31d944308bb09be72a70e6ef8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sun, 9 Dec 2012 18:00:23 -0800 Subject: [PATCH] Never return null from #getBounds. --- src/path/Path.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/path/Path.js b/src/path/Path.js index 04446442..330bb8d8 100644 --- a/src/path/Path.js +++ b/src/path/Path.js @@ -1857,8 +1857,10 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{ // http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html var segments = this._segments, first = segments[0]; + // If there are no segments, return "empty" rectangle, just like groups, + // since #bounds is assumed to never return null. if (!first) - return null; + return new Rectangle(); var coords = new Array(6), prevCoords = new Array(6); // Make coordinates for first segment available in prevCoords.