Skip to content

Commit

Permalink
fix: Support case where global.navigator exists but lacks MIDI API
Browse files Browse the repository at this point in the history
  • Loading branch information
motiz88 committed Jun 19, 2016
1 parent 035fbc3 commit e630931
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const reducer = myDuck.createReducer({
import sortBy from 'lodash.sortby';
import deepEqual from 'deep-equal';

const defaultRequestMIDIAccess = (global && global.navigator && global.navigator.requestMIDIAccess.bind(global.navigator)) || (
const defaultRequestMIDIAccess = (global && global.navigator && (typeof global.navigator.requestMIDIAccess === 'function') && global.navigator.requestMIDIAccess.bind(global.navigator)) || (
() => Promise.reject(new Error('Web MIDI API not available'))
);

Expand Down

0 comments on commit e630931

Please sign in to comment.