Check for runtime.currentStepTime is null

This commit is contained in:
Eric Rosenbaum 2018-02-06 12:25:44 -05:00
parent 0a239005a9
commit 33966ba582

View file

@ -236,7 +236,7 @@ class Scratch3SensingBlocks {
getLoudness () { getLoudness () {
if (typeof this.runtime.audioEngine === 'undefined') return -1; 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 // Only measure loudness once per step
const timeSinceLoudness = this._timer.time() - this._cachedLoudnessTimestamp; const timeSinceLoudness = this._timer.time() - this._cachedLoudnessTimestamp;