avoid a rare script-crash

This commit is contained in:
Seth Alves 2017-04-26 10:19:50 -07:00
parent ec687bdb4b
commit 37233b9fdb

View file

@ -447,6 +447,10 @@ Grabber.prototype.moveEvent = function(event) {
// see if something added/restored gravity
var entityProperties = Entities.getEntityProperties(this.entityID);
if (!entityProperties || !entityProperties.gravity) {
return;
}
if (Vec3.length(entityProperties.gravity) !== 0.0) {
this.originalGravity = entityProperties.gravity;
}