This repository was archived by the owner on Mar 16, 2026. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -3528,9 +3528,15 @@ for (byte pass = 0; pass < 2; pass++) {
35283528#endif
35293529 myDir.close ();
35303530
3531- for (byte i = 0 ; i < count; i++) {
3531+ if (currFile == 0 ) {
3532+ // Prevent SD error on empty folder
3533+ count = 1 ;
3534+ snprintf (answers[0 ], FILEOPTS_LENGTH, " %s" , " Empty folder" );
3535+ } else {
35323536 // Copy short string into fileOptions
3533- snprintf (answers[i], FILEOPTS_LENGTH, " %s" , fileNames[i]);
3537+ for (byte i = 0 ; i < count; i++) {
3538+ snprintf (answers[i], FILEOPTS_LENGTH, " %s" , fileNames[i]);
3539+ }
35343540 }
35353541
35363542 // Create menu with title and 1-7 options to choose from
@@ -3542,6 +3548,11 @@ for (byte pass = 0; pass < 2; pass++) {
35423548 goto page;
35433549 }
35443550
3551+ // Setting root after question_box still allows to escape empty folder by scrolling left
3552+ if (strcmp (answers[0 ], " Empty folder" ) == 0 ) {
3553+ root = 1 ;
3554+ }
3555+
35453556 // Check if we are supposed to go back to the root dir
35463557 if (root) {
35473558 // Change working dir to root
You can’t perform that action at this time.
0 commit comments