From 28e42d3306cf7947e57df7675cefe4cc31062126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Sat, 10 Apr 2021 22:28:30 +0200 Subject: [PATCH] Shell: Update: Print error if no update file name is specified --- stm-firmware/shell.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stm-firmware/shell.c b/stm-firmware/shell.c index e56244d..51fcef3 100644 --- a/stm-firmware/shell.c +++ b/stm-firmware/shell.c @@ -655,6 +655,11 @@ shellmatta_retCode_t shell_cmd_update(const shellmatta_handle_t handle, const ch } } + if (!update_file || !strlen(update_file)) { + shellmatta_printf(handle, "Please specify a valid update file!\r\n"); + return SHELLMATTA_ERROR; + } + updater_update_from_file(update_file); return SHELLMATTA_OK;