From e630931709cf4184f70c958b540f7f93b233b068 Mon Sep 17 00:00:00 2001 From: Moti Zilberman Date: Sun, 19 Jun 2016 15:46:57 +0300 Subject: [PATCH] fix: Support case where global.navigator exists but lacks MIDI API --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 6292a07..2100be1 100644 --- a/src/index.js +++ b/src/index.js @@ -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')) );