Mercurial > hg > webaudioevaluationtool
changeset 1212:98d9ada911f2
Fix Safari error (event.currentTarget.owner) line 1365
author | Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk> |
---|---|
date | Tue, 23 Feb 2016 11:56:11 +0000 |
parents | 89a0d8b18919 |
children | 69394f0fd142 |
files | core.js |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/core.js Tue Feb 23 11:41:25 2016 +0000 +++ b/core.js Tue Feb 23 11:56:11 2016 +0000 @@ -1362,7 +1362,9 @@ this.bufferNode.onended = function(event) { // Safari does not like using 'this' to reference the calling object! //event.currentTarget.owner.metric.stopListening(audioEngineContext.timer.getTestTime(),event.currentTarget.owner.getCurrentPosition()); - event.currentTarget.owner.stop(audioContext.currentTime+1); + if (event.currentTarget != null) { + event.currentTarget.owner.stop(audioContext.currentTime+1); + } }; if (this.bufferNode.loop == false) { this.metric.startListening(audioEngineContext.timer.getTestTime());