From 1da1c1dce193b17ba2417c55da59398af54c9649 Mon Sep 17 00:00:00 2001 From: ericrius1 Date: Mon, 21 Mar 2016 10:57:51 -0700 Subject: [PATCH] only disconnect if connected --- .../cuckooClock/cuckooClockMinuteHandEntityScript.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/unpublishedScripts/DomainContent/Home/cuckooClock/cuckooClockMinuteHandEntityScript.js b/unpublishedScripts/DomainContent/Home/cuckooClock/cuckooClockMinuteHandEntityScript.js index 2264670e32..af2c49205c 100644 --- a/unpublishedScripts/DomainContent/Home/cuckooClock/cuckooClockMinuteHandEntityScript.js +++ b/unpublishedScripts/DomainContent/Home/cuckooClock/cuckooClockMinuteHandEntityScript.js @@ -85,18 +85,23 @@ var myDate = new Date(); var seconds = myDate.getSeconds(); secondRollDegrees = -seconds * DEGREES_FOR_SECOND; - Entities.editEntity(_this.secondHand, {rotation: Quat.fromPitchYawRollDegrees(0, 0, secondRollDegrees)}); + Entities.editEntity(_this.secondHand, { + rotation: Quat.fromPitchYawRollDegrees(0, 0, secondRollDegrees) + }); }, unload: function() { - Script.update.disconnect(_this.update); + if (connected === true) { + connected = false; + Script.update.disconnect(_this.update); + } }, update: function() { - if(iOwn === false) { + if (iOwn === false) { return; }