Skip to content

Commit 3f59ac6

Browse files
authored
feat(midi): avoids possible strlen(NULL)
1 parent 861abb9 commit 3f59ac6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cores/esp32/Arduino.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ size_t getArduinoLoopTaskStackSize(void);
232232
*/
233233
#define SET_USB_MIDI_DEVICE_NAME(name) \
234234
const char* getUSBMIDIDefaultDeviceName() { \
235-
if (strlen(name) == 0) { \
235+
if (!name || strlen(name) == 0) { \
236236
return ESP32_USB_MIDI_DEFAULT_NAME; \
237237
} \
238238
return name; \

0 commit comments

Comments
 (0)