Skip to content

Commit

Permalink
Made guard condition for sampleRate more robust (katspaugh#1467)
Browse files Browse the repository at this point in the history
Prior code was doing insufficient checking when setting a default and would thus facilitate an error condition in iOS.
  • Loading branch information
Dan D authored and thijstriemstra committed Sep 28, 2018
1 parent 8f8006d commit 3fb0d06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/webaudio.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ export default class WebAudio extends util.Observer {
decodeArrayBuffer(arraybuffer, callback, errback) {
if (!this.offlineAc) {
this.offlineAc = this.getOfflineAudioContext(
this.ac ? this.ac.sampleRate : 44100
this.ac && this.ac.sampleRate ? this.ac.sampleRate : 44100
);
}
this.offlineAc.decodeAudioData(
Expand Down

0 comments on commit 3fb0d06

Please sign in to comment.