SaveTool: fix a segfault.

This commit is contained in:
Guillaume Jacquemin 2022-03-09 14:02:56 +01:00
parent dd9dcdb5f6
commit 4ae9f83ab3

View file

@ -375,6 +375,11 @@ void SaveTool::updateCheckEvent(SDL_Event& event) {
} }
void SaveTool::fileUpdateEvent(SDL_Event& event) { void SaveTool::fileUpdateEvent(SDL_Event& event) {
if(event.user.code == StagedUpdate) {
_massManager->refreshStagedMasses();
return;
}
Containers::String filename{static_cast<char*>(event.user.data1), std::strlen(static_cast<char*>(event.user.data1)), nullptr}; Containers::String filename{static_cast<char*>(event.user.data1), std::strlen(static_cast<char*>(event.user.data1)), nullptr};
Containers::String old_filename; Containers::String old_filename;
@ -444,9 +449,6 @@ void SaveTool::fileUpdateEvent(SDL_Event& event) {
} }
} }
break; break;
case StagedUpdate:
_massManager->refreshStagedMasses();
break;
default: default:
_queue.addToast(Toast::Type::Warning, "Unknown file action type"_s); _queue.addToast(Toast::Type::Warning, "Unknown file action type"_s);
} }