From 79ca805c4879bcd299352d262cfdceef5e9cac4f Mon Sep 17 00:00:00 2001 From: lunarcleint <88809950+lunarcleint@users.noreply.github.com> Date: Mon, 5 Feb 2024 23:18:23 -0700 Subject: [PATCH] =?UTF-8?q?how=20do=20i=20still=20forget=20null=20checks?= =?UTF-8?q?=20=F0=9F=98=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/funkin/game/GameOverSubstate.hx | 2 +- source/funkin/menus/GitarooPause.hx | 2 +- source/funkin/menus/PauseSubState.hx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/funkin/game/GameOverSubstate.hx b/source/funkin/game/GameOverSubstate.hx index f7bd5cff2..b2f7636f4 100644 --- a/source/funkin/game/GameOverSubstate.hx +++ b/source/funkin/game/GameOverSubstate.hx @@ -115,7 +115,7 @@ class GameOverSubstate extends MusicBeatSubstate PlayState.instance.saveWarn(false); else { PlayState.resetSongInfos(); - Charter.instance.__clearStatics(); + if (Charter.instance != null) Charter.instance.__clearStatics(); if (FlxG.sound.music != null) FlxG.sound.music.stop(); diff --git a/source/funkin/menus/GitarooPause.hx b/source/funkin/menus/GitarooPause.hx index 296f51344..bc7821210 100644 --- a/source/funkin/menus/GitarooPause.hx +++ b/source/funkin/menus/GitarooPause.hx @@ -66,7 +66,7 @@ class GitarooPause extends MusicBeatState else { PlayState.resetSongInfos(); - Charter.instance.__clearStatics(); + if (Charter.instance != null) Charter.instance.__clearStatics(); FlxG.switchState(new MainMenuState()); } diff --git a/source/funkin/menus/PauseSubState.hx b/source/funkin/menus/PauseSubState.hx index a7d8f9eee..2fe5e85a6 100644 --- a/source/funkin/menus/PauseSubState.hx +++ b/source/funkin/menus/PauseSubState.hx @@ -163,7 +163,7 @@ class PauseSubState extends MusicBeatSubstate PlayState.instance.saveWarn(false); else { PlayState.resetSongInfos(); - Charter.instance.__clearStatics(); + if (Charter.instance != null) Charter.instance.__clearStatics(); CoolUtil.playMenuSong(); FlxG.switchState(PlayState.isStoryMode ? new StoryMenuState() : new FreeplayState());