From 9b5cfe856c38846c965c535a07c8810f4fb0f3bf Mon Sep 17 00:00:00 2001
From: MIDIMan <miditheman2.0@gmail.com>
Date: Fri, 8 Sep 2023 22:03:25 -0400
Subject: [PATCH] Add a mapheader check to M_CampaignWarpIsCheat

---
 src/m_cond.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/m_cond.c b/src/m_cond.c
index 6c87ebf6e5..706a1b5106 100644
--- a/src/m_cond.c
+++ b/src/m_cond.c
@@ -509,7 +509,7 @@ UINT8 M_CampaignWarpIsCheat(INT32 gt, INT32 mapnum, gamedata_t *data)
 		return true;
 	}
 
-	if (mapheaderinfo[mapnum-1]->menuflags & LF2_HIDEINMENU)
+	if (!mapheaderinfo[mapnum-1] || mapheaderinfo[mapnum-1]->menuflags & LF2_HIDEINMENU)
 	{
 		// You're never allowed to warp to this level.
 		return true;
-- 
GitLab