From be0776010364fda81554a845461d71a2ad4a16a1 Mon Sep 17 00:00:00 2001
From: EliteMasterEric <ericmyllyoja@gmail.com>
Date: Wed, 8 May 2024 00:08:44 -0400
Subject: [PATCH] Fix a crash when querying FlxG.state

---
 source/funkin/util/logging/CrashHandler.hx | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/source/funkin/util/logging/CrashHandler.hx b/source/funkin/util/logging/CrashHandler.hx
index 8cfa2270f..71d1ad394 100644
--- a/source/funkin/util/logging/CrashHandler.hx
+++ b/source/funkin/util/logging/CrashHandler.hx
@@ -141,7 +141,9 @@ class CrashHandler
 
     fullContents += '\n';
 
-    fullContents += 'Flixel Current State: ${Type.getClassName(Type.getClass(FlxG.state))}\n';
+    var currentState = FlxG.state != null ? Type.getClassName(Type.getClass(FlxG.state)) : 'No state loaded';
+
+    fullContents += 'Flixel Current State: ${currentState}\n';
 
     fullContents += '\n';