1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-12 20:49:49 +04:00

Loader: fix crash on locked via cli loader

This commit is contained in:
SG
2024-06-12 17:35:15 +01:00
committed by MX
parent 198059e76c
commit 4f6aff4bd1

View File

@@ -463,13 +463,19 @@ static LoaderStatus loader_do_start_by_name(
do {
// check lock
if(loader_do_is_locked(loader)) {
const char* current_thread_name =
furi_thread_get_name(furi_thread_get_id(loader->app.thread));
status = loader_make_status_error(
LoaderStatusErrorAppStarted,
error_message,
"Loader is locked, please close the \"%s\" first",
current_thread_name);
if(loader->app.thread == (FuriThread*)LOADER_MAGIC_THREAD_VALUE) {
status = loader_make_status_error(
LoaderStatusErrorAppStarted, error_message, "Loader is locked");
} else {
const char* current_thread_name =
furi_thread_get_name(furi_thread_get_id(loader->app.thread));
status = loader_make_status_error(
LoaderStatusErrorAppStarted,
error_message,
"Loader is locked, please close the \"%s\" first",
current_thread_name);
}
break;
}