From 37233b9fdb8e2a2d68a3cba1d6afd95d8857f85c Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Wed, 26 Apr 2017 10:19:50 -0700 Subject: [PATCH] avoid a rare script-crash --- scripts/system/controllers/grab.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/system/controllers/grab.js b/scripts/system/controllers/grab.js index 10f477b3af..f96ad81719 100644 --- a/scripts/system/controllers/grab.js +++ b/scripts/system/controllers/grab.js @@ -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; }