diff --git a/src/SaveTool/SaveTool_FileWatcher.cpp b/src/SaveTool/SaveTool_FileWatcher.cpp
index 3387740..a8bf0a8 100644
--- a/src/SaveTool/SaveTool_FileWatcher.cpp
+++ b/src/SaveTool/SaveTool_FileWatcher.cpp
@@ -14,10 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
+#include
#include
#include
#include
+#include
#include
#include
@@ -98,7 +100,11 @@ void SaveTool::fileUpdateEvent(SDL_Event& event) {
if(is_current_profile) {
_currentProfile = nullptr;
_uiState = UiState::ProfileManager;
- _profileManager->refreshProfiles();
+ if(!_profileManager->refreshProfiles()) {
+ SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error",
+ _profileManager->lastError().data(), window());
+ exit(EXIT_FAILURE);
+ }
}
else if(is_unit) {
if(!_currentMass || _currentMass != &(_massManager->hangar(index))) {
diff --git a/src/SaveTool/SaveTool_ProfileManager.cpp b/src/SaveTool/SaveTool_ProfileManager.cpp
index 08a037d..50a5c85 100644
--- a/src/SaveTool/SaveTool_ProfileManager.cpp
+++ b/src/SaveTool/SaveTool_ProfileManager.cpp
@@ -52,7 +52,8 @@ void SaveTool::drawProfileManager() {
ImGui::TableSetColumnIndex(1);
if(ImGui::SmallButton("Refresh")) {
if(!_profileManager->refreshProfiles()) {
- SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error in ProfileManager", _profileManager->lastError().data(), window());
+ SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error",
+ _profileManager->lastError().data(), window());
exit(EXIT_FAILURE);
}
}
@@ -159,7 +160,11 @@ auto SaveTool::drawBackupListPopup() -> ImGuiID {
if(!_profileManager->restoreBackup(backup_index)) {
_queue.addToast(Toast::Type::Error, _profileManager->lastError());
}
- _profileManager->refreshProfiles();
+ if(!_profileManager->refreshProfiles()) {
+ SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error",
+ _profileManager->lastError().data(), window());
+ exit(EXIT_FAILURE);
+ }
ImGui::CloseCurrentPopup();
}
ImGui::SameLine();