summaryrefslogtreecommitdiff
path: root/soh/src/code/z_parameter.c
diff options
context:
space:
mode:
authorbriaguya <70942617+briaguya-ai@users.noreply.github.com>2022-12-08 10:44:08 -0500
committerGitHub <noreply@github.com>2022-12-08 10:44:08 -0500
commitfa4ffb5913ce7f9c568c07b48678e7fd237633d6 (patch)
treec416b63709cd413b070f127bfa93b5bb9a0e70a7 /soh/src/code/z_parameter.c
parent025e18e7e5bb5c432d23a970ff7ca8e071c131b8 (diff)
fix: ensure `play` isn't null when reading from it (#2115)
Co-authored-by: briaguya <briaguya>
Diffstat (limited to 'soh/src/code/z_parameter.c')
-rw-r--r--soh/src/code/z_parameter.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c
index 537d185bd..22cb5f4db 100644
--- a/soh/src/code/z_parameter.c
+++ b/soh/src/code/z_parameter.c
@@ -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)) {