From 2b7aa545c94e792d9200be4a3fa4e906acc04b37 Mon Sep 17 00:00:00 2001 From: Ken Van Hoeylandt Date: Sat, 23 Aug 2025 21:33:14 +0200 Subject: [PATCH] Return error when DevelopmentService fails to find external app to run --- Tactility/Source/service/development/DevelopmentService.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Tactility/Source/service/development/DevelopmentService.cpp b/Tactility/Source/service/development/DevelopmentService.cpp index 959f8efb..6091816f 100644 --- a/Tactility/Source/service/development/DevelopmentService.cpp +++ b/Tactility/Source/service/development/DevelopmentService.cpp @@ -18,6 +18,7 @@ #include #include #include +#include namespace tt::service::development { @@ -198,6 +199,11 @@ esp_err_t DevelopmentService::handleAppRun(httpd_req_t* request) { auto app_id = id_key_pos->second; if (app_id.ends_with(".app.elf")) { + if (!file::isFile(app_id)) { + TT_LOG_W(TAG, "[400] /app/run cannot find app %s", app_id.c_str()); + httpd_resp_send_err(request, HTTPD_400_BAD_REQUEST, "app not found"); + return ESP_FAIL; + } app::registerElfApp(app_id); app_id = app::getElfAppId(app_id); } else if (!app::findAppById(app_id.c_str())) {