Skip to content

Commit

Permalink
Windows: Prevent crash on null symbol map.
Browse files Browse the repository at this point in the history
Happened during a double error scenario, but might as well check.
  • Loading branch information
unknownbrackets committed Feb 5, 2021
1 parent aca9953 commit 7f996f5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Windows/WindowsHost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ void WindowsHost::PollControllers() {
}

void WindowsHost::BootDone() {
g_symbolMap->SortSymbols();
if (g_symbolMap)
g_symbolMap->SortSymbols();
PostMessage(mainWindow_, WM_USER + 1, 0, 0);

SetDebugMode(!g_Config.bAutoRun);
Expand Down Expand Up @@ -295,6 +296,8 @@ static std::string SymbolMapFilename(const char *currentFilename, const char* ex
}

bool WindowsHost::AttemptLoadSymbolMap() {
if (!g_symbolMap)
return false;
bool result1 = g_symbolMap->LoadSymbolMap(SymbolMapFilename(PSP_CoreParameter().fileToStart.c_str(),".ppmap").c_str());
// Load the old-style map file.
if (!result1)
Expand All @@ -304,11 +307,13 @@ bool WindowsHost::AttemptLoadSymbolMap() {
}

void WindowsHost::SaveSymbolMap() {
g_symbolMap->SaveSymbolMap(SymbolMapFilename(PSP_CoreParameter().fileToStart.c_str(),".ppmap").c_str());
if (g_symbolMap)
g_symbolMap->SaveSymbolMap(SymbolMapFilename(PSP_CoreParameter().fileToStart.c_str(),".ppmap").c_str());
}

void WindowsHost::NotifySymbolMapUpdated() {
g_symbolMap->SortSymbols();
if (g_symbolMap)
g_symbolMap->SortSymbols();
PostMessage(mainWindow_, WM_USER + 1, 0, 0);
}

Expand Down

0 comments on commit 7f996f5

Please sign in to comment.