Add sanity check in case no path

This commit is contained in:
Luc
2026-01-15 18:53:25 +08:00
parent 12c30f283d
commit 693f31fb45
2 changed files with 6 additions and 2 deletions

View File

@@ -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();

View File

@@ -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();