From acd2caf26c279111043ea554606d07cb795b705f Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Tue, 23 Feb 2016 16:35:20 -0800 Subject: [PATCH] handle case where user grab data didn't have a heartbeat --- examples/controllers/handControllerGrab.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/controllers/handControllerGrab.js b/examples/controllers/handControllerGrab.js index ad5f1c3775..7db4a0ee8b 100644 --- a/examples/controllers/handControllerGrab.js +++ b/examples/controllers/handControllerGrab.js @@ -1731,7 +1731,8 @@ function MyController(hand) { }; Entities.editEntity(entityID, whileHeldProperties); } else if (data["refCount"] > 1) { - if (now - data["heartBeat"] > HEART_BEAT_TIMEOUT) { + if (data["heartBeat"] === undefined || + now - data["heartBeat"] > HEART_BEAT_TIMEOUT) { // this entity has userData suggesting it is grabbed, but nobody is updating the hearbeat. // deactivate it before grabbing. this.resetAbandonedGrab(entityID);