From b46a210ffb80d1d79720b9067176a3d00ffdc57d Mon Sep 17 00:00:00 2001 From: Fernando Arzola <17498701+Arufonsu@users.noreply.github.com> Date: Thu, 8 Aug 2024 21:20:30 -0400 Subject: [PATCH] fix: dereference of possibly null references in core graphics (#2377) - Null Check: RenderingEntities == null checks if RenderingEntities is not initialized. - Null Check: Globals.MapGrid == null checks if the 2D array is not initialized. - Removed default Check: Globals.MapGrid is an array, checking against default is unnecessary. --- Intersect.Client/Core/Graphics.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Intersect.Client/Core/Graphics.cs b/Intersect.Client/Core/Graphics.cs index 4130884fd..529375708 100644 --- a/Intersect.Client/Core/Graphics.cs +++ b/Intersect.Client/Core/Graphics.cs @@ -241,7 +241,7 @@ public static void DrawInGame(TimeSpan deltaTime) return; } - if (Globals.NeedsMaps || Globals.MapGrid == default) + if (Globals.NeedsMaps || Globals.MapGrid == null || RenderingEntities == null) { return; }