diff --git a/src/m_cond.c b/src/m_cond.c
index 6c87ebf6e5d8fb30789be6b5675f10daa574a22e..706a1b5106f487e4ed285880304a87335f7f716e 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;