- 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

View file

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