1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-01 18:43:33 +02:00

Add NULL guards to Game::savestats() and savesettings()

This is so those functions can safely be called when
graphics.screenbuffer is NULL.
This commit is contained in:
Misa 2021-02-15 18:38:42 -08:00 committed by Ethan Lee
parent 1f1b39a77a
commit 39e316828e

View File

@ -4708,6 +4708,11 @@ void Game::deserializesettings(tinyxml2::XMLElement* dataNode, ScreenSettings* s
bool Game::savestats()
{
if (graphics.screenbuffer == NULL)
{
return false;
}
ScreenSettings screen_settings;
graphics.screenbuffer->GetSettings(&screen_settings);
@ -4950,6 +4955,11 @@ void Game::loadsettings(ScreenSettings* screen_settings)
bool Game::savesettings()
{
if (graphics.screenbuffer == NULL)
{
return false;
}
ScreenSettings screen_settings;
graphics.screenbuffer->GetSettings(&screen_settings);