check alerter before alert

pull/415/head
Li Linfeng 2019-09-22 13:45:00 +08:00
parent 76132b1808
commit 5c55ef3308
1 changed files with 4 additions and 2 deletions

View File

@ -985,7 +985,8 @@ int LuaState::resume()
if (appCore != NULL)
{
CelestiaCore::Alerter* alerter = appCore->getAlerter();
alerter->fatalError(errorMessage);
if (alerter)
alerter->fatalError(errorMessage);
}
return 1; // just the error string
@ -3547,7 +3548,8 @@ bool LuaState::init(CelestiaCore* appCore)
// copy string?!
const char* errorMessage = lua_tostring(state, -1);
cout << errorMessage << '\n'; cout.flush();
alerter->fatalError(errorMessage);
if (alerter)
alerter->fatalError(errorMessage);
return false;
}
#endif