From 33966ba5829a0c723e1e528719e7fde4589dd975 Mon Sep 17 00:00:00 2001 From: Eric Rosenbaum Date: Tue, 6 Feb 2018 12:25:44 -0500 Subject: [PATCH] Check for runtime.currentStepTime is null --- src/blocks/scratch3_sensing.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/blocks/scratch3_sensing.js b/src/blocks/scratch3_sensing.js index fd60c4caa..2c19683ad 100644 --- a/src/blocks/scratch3_sensing.js +++ b/src/blocks/scratch3_sensing.js @@ -236,7 +236,7 @@ class Scratch3SensingBlocks { getLoudness () { if (typeof this.runtime.audioEngine === 'undefined') return -1; - if (typeof this.runtime.currentStepTime === 'undefined') return -1; + if (this.runtime.currentStepTime === null) return -1; // Only measure loudness once per step const timeSinceLoudness = this._timer.time() - this._cachedLoudnessTimestamp;