Add NULL checks and asserts to graphic options

The game dereferences graphics.screenbuffer without checking it first...
it's unlikely to happen, but the least we can to do be safe is to add a
check and assert here.
This commit is contained in:
Misa authored and Ethan Lee committed 2021-04-22 19:42:32 -04:00
1 parent 0fc17ec277
commit 960bd4a519
2 files changed
+12

No files matched your search

+6
View File
@@ -445,6 +445,12 @@ static void menuactionpress(void)
map.nexttowercolour();
break;
case Menu::graphicoptions:
if (graphics.screenbuffer == NULL)
{
SDL_assert(0 && "Screenbuffer is NULL!");
break;
}
switch (game.currentmenuoption)
{
case 0:
+6
View File
@@ -251,6 +251,12 @@ static void menurender(void)
}
break;
case Menu::graphicoptions:
if (graphics.screenbuffer == NULL)
{
SDL_assert(0 && "Screenbuffer is NULL!");
break;
}
switch (game.currentmenuoption)
{
case 0: