From aaa6038d282d9362ee3f50347d8520449ec84ee3 Mon Sep 17 00:00:00 2001 From: Cristian Luis Duarte Date: Fri, 11 May 2018 22:27:58 -0300 Subject: [PATCH] Prevent calling ending on displayNames if was never started --- scripts/system/+android/displayNames.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/system/+android/displayNames.js b/scripts/system/+android/displayNames.js index 1e9735d205..9f226f5ce0 100644 --- a/scripts/system/+android/displayNames.js +++ b/scripts/system/+android/displayNames.js @@ -128,7 +128,13 @@ function excludeMyAvatar() { rayExclusionList = [MyAvatar.sessionUUID]; } +var runAtLeastOnce = false; + function ending() { + if (!runAtLeastOnce) { + return; + } + Controller.touchBeginEvent.disconnect(touchBegin); Controller.touchEndEvent.disconnect(touchEnd); Controller.mousePressEvent.disconnect(touchBegin); @@ -157,6 +163,8 @@ function init() { rayExclusionList = [MyAvatar.sessionUUID]; MyAvatar.sessionUUIDChanged.connect(excludeMyAvatar); + + runAtLeastOnce = true; } module.exports = {