Skip to content

Commit 9258d67

Browse files
committed
Handle case where the midi device is device 0
1 parent cf142fc commit 9258d67

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/widget.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,12 +259,12 @@ export class XTouchMiniModel extends DOMWidgetModel {
259259
}
260260

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

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

0 commit comments

Comments
 (0)