Browse Source

🩹 Handle nullptr in CardReader::printLongPath (#23197)

Jason Smith 3 years ago
parent
commit
1861f780de
No account linked to committer's email address
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      Marlin/src/sd/cardreader.cpp

+ 1
- 1
Marlin/src/sd/cardreader.cpp View File

359
   //
359
   //
360
   void CardReader::printLongPath(char * const path) {
360
   void CardReader::printLongPath(char * const path) {
361
 
361
 
362
-    int i, pathLen = strlen(path);
362
+    int i, pathLen = path ? strlen(path) : 0;
363
 
363
 
364
     // SERIAL_ECHOPGM("Full Path: "); SERIAL_ECHOLN(path);
364
     // SERIAL_ECHOPGM("Full Path: "); SERIAL_ECHOLN(path);
365
 
365
 

Loading…
Cancel
Save