From 9238f508eb99d372b1a49c4ef68815a5806ac37a Mon Sep 17 00:00:00 2001 From: Adam Zmuda Date: Wed, 18 Jun 2025 10:05:18 +0200 Subject: [PATCH] Fix #14081: Check if removed item is a savegame (#14371) --- src/console_cmds.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp index ebc6293355..3293c4704f 100644 --- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -543,8 +543,12 @@ static bool ConRemove(std::span argv) _console_file_list_savegame.ValidateFileList(); const FiosItem *item = _console_file_list_savegame.FindItem(file); if (item != nullptr) { - if (!FioRemove(item->name)) { - IConsolePrint(CC_ERROR, "Failed to delete '{}'.", item->name); + if (item->type.abstract == FT_SAVEGAME) { + if (!FioRemove(item->name)) { + IConsolePrint(CC_ERROR, "Failed to delete '{}'.", item->name); + } + } else { + IConsolePrint(CC_ERROR, "'{}' is not a savegame.", file); } } else { IConsolePrint(CC_ERROR, "'{}' could not be found.", file);