From dbfab2906e92bf31d3414bdb421a2dc480ccba76 Mon Sep 17 00:00:00 2001 From: Patrick Machielse Date: Fri, 8 Nov 2024 15:52:48 +0100 Subject: [PATCH] Now defaulting to a command lenght of 1 if we couldn't figure it out. --- Source/MIKMIDICommand.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/MIKMIDICommand.m b/Source/MIKMIDICommand.m index d83ffa4..4c63893 100644 --- a/Source/MIKMIDICommand.m +++ b/Source/MIKMIDICommand.m @@ -75,8 +75,11 @@ + (NSArray *)commandsWithMIDIPacket:(MIDIPacket *)inputPacket default: { __auto_type standardLength = MIKMIDIStandardLengthOfMessageForCommandType(commandType); - NSAssert(standardLength > 0, @"message length failed for command type %lu", commandType); - eventDataLength = (ByteCount)standardLength; + if ( standardLength > 0 ) { + eventDataLength = (ByteCount)standardLength; + } else { /* -1 or NSIntegerMin */ + eventDataLength = 1; /* assume 1 and hope for the best */ + } break; } }