- fixed: The FFont* serializer was unable to handle null pointers.

This commit is contained in:
Christoph Oelckers 2019-03-13 07:11:46 +01:00
parent 7f8b048347
commit 43ca814da8
1 changed files with 2 additions and 7 deletions

View File

@ -2147,19 +2147,14 @@ template<> FSerializer &Serialize(FSerializer &arc, const char *key, FFont *&fon
{
if (arc.isWriting())
{
FName n = font->GetName();
FName n = font? font->GetName() : NAME_None;
return arc(key, n);
}
else
{
FName n = NAME_None;
arc(key, n);
font = V_GetFont(n);
if (font == nullptr)
{
Printf(TEXTCOLOR_ORANGE "Could not load font %s\n", n.GetChars());
font = SmallFont;
}
font = n == NAME_None? nullptr : V_GetFont(n);
return arc;
}