More robust checks

This commit is contained in:
Richard Davey 2020-01-10 10:52:54 +00:00
parent 0d66c98ff0
commit e27914792e

View file

@ -1349,6 +1349,8 @@ var MatterPhysics = new Class({
*/
alignBody: function (body, x, y, align)
{
body = (body.hasOwnProperty('body')) ? body.body : body;
var pos;
switch (align)
@ -1394,7 +1396,10 @@ var MatterPhysics = new Class({
break;
}
Body.setPosition(body, pos);
if (pos)
{
Body.setPosition(body, pos);
}
return this;
},