Skip to content

Commit

Permalink
Handle case where the midi device is device 0
Browse files Browse the repository at this point in the history
  • Loading branch information
jasongrout committed Nov 18, 2019
1 parent cf142fc commit 9258d67
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,12 @@ export class XTouchMiniModel extends DOMWidgetModel {
}

const input = midi.inputs.findIndex(x => x.manufacturer === "Behringer" && x.name.startsWith("X-TOUCH MINI"));
if (!input) {
if (input === -1) {
throw new Error("Could not find Behringer X-TOUCH MINI input");
}

const output = midi.outputs.findIndex(x => x.manufacturer === "Behringer" && x.name.startsWith("X-TOUCH MINI"));
if (!output) {
if (output === -1) {
throw new Error("Could not find Behringer X-TOUCH MINI output");
}

Expand Down

0 comments on commit 9258d67

Please sign in to comment.