Skip to content

Commit a50f89f

Browse files
committed
ensure root path is usable
1 parent a814bfb commit a50f89f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

examples/companion_radio/MyMesh.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,8 +1312,9 @@ void MyMesh::checkCLIRescueCmd() {
13121312

13131313
// log each file and directory
13141314
File root = _store->openRead(path);
1315-
File file = root.openNextFile();
1316-
while (file) {
1315+
if(root){
1316+
File file = root.openNextFile();
1317+
while (file) {
13171318

13181319
if (file.isDirectory()) {
13191320
Serial.print("[dir] ");
@@ -1329,6 +1330,7 @@ void MyMesh::checkCLIRescueCmd() {
13291330
// move to next file
13301331
file = root.openNextFile();
13311332

1333+
}
13321334
}
13331335

13341336
} else if (memcmp(cli_command, "cat", 3) == 0) {

0 commit comments

Comments
 (0)