fix: ensure play isn't null when reading from it (#2115)

Co-authored-by: briaguya <briaguya>
This commit is contained in:
briaguya 2022-12-08 10:44:08 -05:00 committed by GitHub
parent 025e18e7e5
commit fa4ffb5913
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2704,7 +2704,7 @@ u8 Item_CheckObtainability(u8 item) {
}
void PerformAutosave(PlayState* play, u8 item) {
if (CVar_GetS32("gAutosave", 0) && (play->sceneNum != SCENE_KENJYANOMA)) {
if (CVar_GetS32("gAutosave", 0) && (play && play->sceneNum != SCENE_KENJYANOMA)) {
if (CVar_GetS32("gAutosaveAllItems", 0)) {
Play_PerformSave(play);
} else if (CVar_GetS32("gAutosaveMajorItems", 1)) {