From 661f6acd120838b5447d322455ca2cdbb62aac17 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquemin Date: Mon, 8 Apr 2024 11:17:48 +0200 Subject: [PATCH] Managers: cleanup includes and add an assert. --- src/Managers/ProfileManager.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Managers/ProfileManager.cpp b/src/Managers/ProfileManager.cpp index aab1024..85c1784 100644 --- a/src/Managers/ProfileManager.cpp +++ b/src/Managers/ProfileManager.cpp @@ -14,10 +14,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -#include - #include -#include #include #include @@ -25,8 +22,6 @@ #include #include -#include - #include "../Configuration/Configuration.h" #include "../Logger/Logger.h" @@ -103,6 +98,8 @@ ProfileManager::getProfile(std::size_t index) { bool ProfileManager::deleteProfile(std::size_t index, bool delete_builds) { + CORRADE_INTERNAL_ASSERT(index < _profiles.size()); + if(!Utility::Path::remove(Utility::Path::join(conf().directories().gameSaves, _profiles[index].filename()))) { _lastError = Utility::format("Couldn't delete {} (filename: {}).", _profiles[index].companyName(),