Skip to content

Commit

Permalink
Merge pull request mixxxdj#14106 from Swiftb0y/fix/script-deckFromGro…
Browse files Browse the repository at this point in the history
…up-undefined-

fix: handle `script.deckFromGroup(undefined)` gracefully
  • Loading branch information
daschuer authored Jan 3, 2025
2 parents 60bfa4c + 6ccb82c commit c04076a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions res/controllers/common-controller-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ script.midiDebug = function(channel, control, value, status, group) {
// Returns the deck number of a "ChannelN" or "SamplerN" group
script.deckFromGroup = function(group) {
let deck = 0;
if (group === undefined) {
return undefined;
}
if (group.substring(2, 8) === "hannel") {
// Extract deck number from the group text
deck = group.substring(8, group.length - 1);
Expand Down

0 comments on commit c04076a

Please sign in to comment.