Add check for nullptr in this func as well
This commit is contained in:
parent
74579be0b1
commit
4ed09b1828
@ -747,9 +747,16 @@ namespace Components
|
|||||||
Script::LastFrameTime = nowMs;
|
Script::LastFrameTime = nowMs;
|
||||||
});
|
});
|
||||||
|
|
||||||
Script::AddFunction("debugBox", [](Game::scr_entref_t)
|
Script::AddFunction("DebugBox", [](Game::scr_entref_t)
|
||||||
{
|
{
|
||||||
MessageBoxA(nullptr, Game::Scr_GetString(0), "DEBUG", 0);
|
const auto* message = Game::Scr_GetString(0);
|
||||||
|
|
||||||
|
if (message == nullptr)
|
||||||
|
{
|
||||||
|
Game::Scr_Error("^1DebugBox: Illegal parameter!\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
MessageBoxA(nullptr, message, "DEBUG", MB_OK);
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
Script::AddFunctions();
|
Script::AddFunctions();
|
||||||
|
Loading…
Reference in New Issue
Block a user