Skip to content

Commit e279147

Browse files
committed
More robust checks
1 parent 0d66c98 commit e279147

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/physics/matter-js/MatterPhysics.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1349,6 +1349,8 @@ var MatterPhysics = new Class({
13491349
*/
13501350
alignBody: function (body, x, y, align)
13511351
{
1352+
body = (body.hasOwnProperty('body')) ? body.body : body;
1353+
13521354
var pos;
13531355

13541356
switch (align)
@@ -1394,7 +1396,10 @@ var MatterPhysics = new Class({
13941396
break;
13951397
}
13961398

1397-
Body.setPosition(body, pos);
1399+
if (pos)
1400+
{
1401+
Body.setPosition(body, pos);
1402+
}
13981403

13991404
return this;
14001405
},

0 commit comments

Comments
 (0)