Skip to content

Commit 45a1869

Browse files
authored
Merge pull request phaserjs#3665 from samme/fix/collideHandler
Fix TypeError when colliding a group as the only argument
2 parents f42b7c9 + 06677c2 commit 45a1869

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

src/physics/arcade/World.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,8 +1410,17 @@ var World = new Class({
14101410
collideObjects: function (object1, object2, collideCallback, processCallback, callbackContext, overlapOnly)
14111411
{
14121412
var i;
1413-
object1 = object1.isParent && typeof(object1.physicsType) === 'undefined' ? object1.children.entries : object1;
1414-
object2 = object2.isParent && typeof(object2.physicsType) === 'undefined' ? object2.children.entries : object2;
1413+
1414+
if (object1.isParent && object1.physicsType === undefined)
1415+
{
1416+
object1 = object1.children.entries;
1417+
}
1418+
1419+
if (object2 && object2.isParent && object2.physicsType === undefined)
1420+
{
1421+
object2 = object2.children.entries;
1422+
}
1423+
14151424
var object1isArray = Array.isArray(object1);
14161425
var object2isArray = Array.isArray(object2);
14171426

0 commit comments

Comments
 (0)