diff --git a/src/geom/Circle.js b/src/geom/Circle.js index 16b21e59a..cd4468212 100644 --- a/src/geom/Circle.js +++ b/src/geom/Circle.js @@ -140,7 +140,7 @@ Phaser.Circle.prototype = { */ clone: function (output) { - if (typeof output === "undefined") + if (typeof output === "undefined" || output === null) { output = new Phaser.Circle(this.x, this.y, this.diameter); } diff --git a/src/geom/Ellipse.js b/src/geom/Ellipse.js index c2ecb5bb4..167913a04 100644 --- a/src/geom/Ellipse.js +++ b/src/geom/Ellipse.js @@ -106,7 +106,7 @@ Phaser.Ellipse.prototype = { */ clone: function(output) { - if (typeof output === "undefined") + if (typeof output === "undefined" || output === null) { output = new Phaser.Ellipse(this.x, this.y, this.width, this.height); } diff --git a/src/geom/Point.js b/src/geom/Point.js index b9cfd96ed..69887e9c5 100644 --- a/src/geom/Point.js +++ b/src/geom/Point.js @@ -222,7 +222,7 @@ Phaser.Point.prototype = { */ clone: function (output) { - if (typeof output === "undefined") + if (typeof output === "undefined" || output === null) { output = new Phaser.Point(this.x, this.y); }