Fix error message handling in LoadRomComponent for better string management

- Updated the error message assignment in LoadRomComponent to ensure proper string handling by explicitly constructing a std::string from the message data.
- This change improves the robustness of error reporting when loading ROM files.
This commit is contained in:
scawful
2025-09-26 23:51:37 -04:00
parent 01ab9951e9
commit 128c9f5bb8

View File

@@ -532,7 +532,7 @@ void LoadRomComponent(ftxui::ScreenInteractive &screen) {
// Load the ROM file here.
auto rom_status = app_context.rom.LoadFromFile(rom_file);
if (!rom_status.ok()) {
app_context.error_message = rom_status.message();
app_context.error_message = std::string(rom_status.message().data(), rom_status.message().size());
SwitchComponents(screen, LayoutID::kError);
return;
}