Skip to content

Commit 9d0438d

Browse files
sjasonsmithmh-dm
authored andcommitted
🩹 Handle nullptr in CardReader::printLongPath (MarlinFirmware#23197)
1 parent 017e98c commit 9d0438d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Marlin/src/sd/cardreader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ void CardReader::ls(TERN_(LONG_FILENAME_HOST_SUPPORT, bool includeLongNames/*=fa
359359
//
360360
void CardReader::printLongPath(char * const path) {
361361

362-
int i, pathLen = strlen(path);
362+
int i, pathLen = path ? strlen(path) : 0;
363363

364364
// SERIAL_ECHOPGM("Full Path: "); SERIAL_ECHOLN(path);
365365

0 commit comments

Comments
 (0)