From 059842b6002b7bbe90eab9cd9ae7b3d09c0188d7 Mon Sep 17 00:00:00 2001 From: MysterD Date: Mon, 9 May 2022 05:09:22 -0700 Subject: [PATCH] Fix crash in geo_switch_mario_cap_on_off --- src/game/mario_misc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/game/mario_misc.c b/src/game/mario_misc.c index e52dd04a1..32bc143cc 100644 --- a/src/game/mario_misc.c +++ b/src/game/mario_misc.c @@ -652,6 +652,7 @@ Gfx* geo_switch_mario_cap_on_off(s32 callContext, struct GraphNode* node, UNUSED struct MarioBodyState* bodyState = geo_get_body_state(); if (callContext == GEO_CONTEXT_RENDER) { + if (switchCase == NULL || bodyState == NULL) { return NULL; } switchCase->selectedCase = bodyState->capState & 1; while (next != node) { if (next->type == GRAPH_NODE_TYPE_TRANSLATION_ROTATION) {