From a50f89f16f1a67b066e3414ae2e6fff4184ecc8b Mon Sep 17 00:00:00 2001 From: liamcottle Date: Sat, 7 Jun 2025 17:38:22 +1200 Subject: [PATCH] ensure root path is usable --- examples/companion_radio/MyMesh.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/companion_radio/MyMesh.cpp b/examples/companion_radio/MyMesh.cpp index 4d3860c3..68e9d615 100644 --- a/examples/companion_radio/MyMesh.cpp +++ b/examples/companion_radio/MyMesh.cpp @@ -1312,8 +1312,9 @@ void MyMesh::checkCLIRescueCmd() { // log each file and directory File root = _store->openRead(path); - File file = root.openNextFile(); - while (file) { + if(root){ + File file = root.openNextFile(); + while (file) { if (file.isDirectory()) { Serial.print("[dir] "); @@ -1329,6 +1330,7 @@ void MyMesh::checkCLIRescueCmd() { // move to next file file = root.openNextFile(); + } } } else if (memcmp(cli_command, "cat", 3) == 0) {