Mercurial > hg > webaudioevaluationtool
changeset 1853:8fad6ccb12d2
Fix Safari error (event.currentTarget.owner) line 1365
author | Nicholas Jillings <nickjillings@users.noreply.github.com> |
---|---|
date | Tue, 23 Feb 2016 11:56:11 +0000 |
parents | e97471529c64 |
children | 2d3ce9d4ca5e |
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());