From 43ca814da8138904f05d62478b04c2da2026b8b1 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 13 Mar 2019 07:11:46 +0100 Subject: [PATCH] - fixed: The FFont* serializer was unable to handle null pointers. --- src/serializer.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/serializer.cpp b/src/serializer.cpp index ab66c792a..eada141d9 100644 --- a/src/serializer.cpp +++ b/src/serializer.cpp @@ -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; }