- don't crash on null pointers in V_GetFont.

This commit is contained in:
Christoph Oelckers 2022-10-20 18:18:22 +02:00
parent 4686d10f41
commit 1855edba37

View file

@ -92,6 +92,7 @@ TArray<PalEntry> TranslationColors;
FFont *V_GetFont(const char *name, const char *fontlumpname) FFont *V_GetFont(const char *name, const char *fontlumpname)
{ {
if (name != nullptr) return nullptr;
if (!stricmp(name, "DBIGFONT")) name = "BigFont"; if (!stricmp(name, "DBIGFONT")) name = "BigFont";
else if (!stricmp(name, "CONFONT")) name = "ConsoleFont"; // several mods have used the name CONFONT directly and effectively duplicated the font. else if (!stricmp(name, "CONFONT")) name = "ConsoleFont"; // several mods have used the name CONFONT directly and effectively duplicated the font.
else if (!stricmp(name, "INDEXFON")) name = "IndexFont"; // Same here - for whatever reason some people had to use its 8 character name... else if (!stricmp(name, "INDEXFON")) name = "IndexFont"; // Same here - for whatever reason some people had to use its 8 character name...