Skip to content

Commit

Permalink
fix: dereference of possibly null references in core graphics (#2377)
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
Arufonsu authored Aug 9, 2024
1 parent 447809f commit b46a210
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Intersect.Client/Core/Graphics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit b46a210

Please sign in to comment.