Skip to content

Commit c1a6191

Browse files
committed
Prevent useMIDIClock from breaking without input
1 parent 507cae0 commit c1a6191

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ export const useMIDIClock = (input, division = 1) => {
128128
};
129129

130130
useEffect(() => {
131+
if (!input) return () => {};
131132
const id = uniqid();
132133
input.clockListeners[id] = handleClockMessage();
133134
return () => delete input.clockListeners[id];

0 commit comments

Comments
 (0)