From 733512f677b4015fe14eb2f60bccc4e0532b70d4 Mon Sep 17 00:00:00 2001 From: hedara90 <90hedara@gmail.com> Date: Thu, 30 Oct 2025 17:14:40 +0100 Subject: [PATCH] Improve sBattleIntroSlideFuncs bounds check (#8084) Co-authored-by: Hedara --- src/battle_intro.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/battle_intro.c b/src/battle_intro.c index 8a335ea481..ebc737dac1 100644 --- a/src/battle_intro.c +++ b/src/battle_intro.c @@ -125,7 +125,8 @@ void HandleIntroSlide(u8 environment) } else { - if (environment >= NELEMS(sBattleIntroSlideFuncs)) + if (environment >= NELEMS(sBattleIntroSlideFuncs) + || sBattleIntroSlideFuncs[environment] == NULL) environment = BATTLE_ENVIRONMENT_PLAIN; taskId = CreateTask(sBattleIntroSlideFuncs[environment], 0); }