G_SaveGameData: check for NULL

This fixes I_Error if used before M_NewDataStruct is
called.
This commit is contained in:
James R 2023-03-03 03:41:02 -08:00 committed by AJ Martinez
parent 87d8945f97
commit d79e53a0e3

View file

@ -4582,7 +4582,7 @@ void G_SaveGameData(void)
UINT8 btemp;
savebuffer_t save = {0};
if (!gamedata->loaded)
if (gamedata == NULL || !gamedata->loaded)
return; // If never loaded (-nodata), don't save
if (usedCheats)