From 02cc41fc9866f7819d221f5a4531d6f5dc792304 Mon Sep 17 00:00:00 2001
From: EliteMasterEric <ericmyllyoja@gmail.com>
Date: Wed, 1 May 2024 11:41:15 -0400
Subject: [PATCH] Catch a potential crash when retrieving the render method

---
 source/funkin/util/logging/CrashHandler.hx | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/source/funkin/util/logging/CrashHandler.hx b/source/funkin/util/logging/CrashHandler.hx
index f7c64c465..240ad6fcf 100644
--- a/source/funkin/util/logging/CrashHandler.hx
+++ b/source/funkin/util/logging/CrashHandler.hx
@@ -243,11 +243,18 @@ class CrashHandler
 
   static function renderMethod():String
   {
-    return switch (FlxG.renderMethod)
+    try
     {
-      case FlxRenderMethod.DRAW_TILES: 'DRAW_TILES';
-      case FlxRenderMethod.BLITTING: 'BLITTING';
-      default: 'UNKNOWN';
+      return switch (FlxG.renderMethod)
+      {
+        case FlxRenderMethod.DRAW_TILES: 'DRAW_TILES';
+        case FlxRenderMethod.BLITTING: 'BLITTING';
+        default: 'UNKNOWN';
+      }
+    }
+    catch (e)
+    {
+      return 'ERROR ON QUERY RENDER METHOD: ${e}';
     }
   }
 }