diff --git a/src/physics/arcade/ArcadePhysics.js b/src/physics/arcade/ArcadePhysics.js index 7db7a380..ca9d548f 100644 --- a/src/physics/arcade/ArcadePhysics.js +++ b/src/physics/arcade/ArcadePhysics.js @@ -268,6 +268,11 @@ Phaser.Physics.Arcade.prototype = { collideGroupVsTilemap: function (group, tilemap, collideCallback, processCallback, callbackContext) { + if (group.length == 0) + { + return; + } + if (group._container.first._iNext) { var currentNode = group._container.first._iNext; @@ -322,6 +327,11 @@ Phaser.Physics.Arcade.prototype = { collideSpriteVsGroup: function (sprite, group, collideCallback, processCallback, callbackContext) { + if (group.length == 0) + { + return; + } + // What is the sprite colliding with in the quadtree? this._potentials = this.quadTree.retrieve(sprite); @@ -353,6 +363,11 @@ Phaser.Physics.Arcade.prototype = { collideGroupVsGroup: function (group1, group2, collideCallback, processCallback, callbackContext) { + if (group1.length == 0 || group2.length == 0) + { + return; + } + if (group1._container.first._iNext) { var currentNode = group1._container.first._iNext;