From 693f31fb452686cc2d51e08eb2d645846e85ee1e Mon Sep 17 00:00:00 2001 From: Luc <8822552+luc-github@users.noreply.github.com> Date: Thu, 15 Jan 2026 18:53:25 +0800 Subject: [PATCH] Add sanity check in case no path --- esp3d/src/modules/http/handlers/handle-SD-files.cpp | 4 +++- esp3d/src/modules/http/handlers/handle-files.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/esp3d/src/modules/http/handlers/handle-SD-files.cpp b/esp3d/src/modules/http/handlers/handle-SD-files.cpp index 7c09910e..cf3461f8 100644 --- a/esp3d/src/modules/http/handlers/handle-SD-files.cpp +++ b/esp3d/src/modules/http/handlers/handle-SD-files.cpp @@ -75,7 +75,9 @@ void HTTP_Server::handleSDFileList() { // get current path if (_webserver->hasArg("path")) { - path += _webserver->arg("path"); + path = _webserver->arg("path"); + } else { + path = "/"; } // to have a clean path path.trim(); diff --git a/esp3d/src/modules/http/handlers/handle-files.cpp b/esp3d/src/modules/http/handlers/handle-files.cpp index 234eb00c..783ac1cd 100644 --- a/esp3d/src/modules/http/handlers/handle-files.cpp +++ b/esp3d/src/modules/http/handlers/handle-files.cpp @@ -63,7 +63,9 @@ void HTTP_Server::handleFSFileList() { } // get current path if (_webserver->hasArg("path")) { - path += _webserver->arg("path"); + path = _webserver->arg("path"); + } else { + path = "/"; } // to have a clean path path.trim();