diff options
Diffstat (limited to 'core/fpdfdoc/cpvt_generateap.cpp')
-rw-r--r-- | core/fpdfdoc/cpvt_generateap.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/fpdfdoc/cpvt_generateap.cpp b/core/fpdfdoc/cpvt_generateap.cpp index a6a64aaf8d..ef55545f9e 100644 --- a/core/fpdfdoc/cpvt_generateap.cpp +++ b/core/fpdfdoc/cpvt_generateap.cpp @@ -923,13 +923,13 @@ void CPVT_GenerateAP::GenerateFormAP(Type type, return; CPDF_DefaultAppearance appearance(DA); - if (!appearance.HasFont()) - return; - ASSERT(appearance.HasFont()); float fFontSize = 0; - ByteString sFontName = - PDF_NameDecode(appearance.GetFont(&fFontSize).AsStringView()); + Optional<ByteString> font = appearance.GetFont(&fFontSize); + if (!font) + return; + + ByteString sFontName = PDF_NameDecode(font->AsStringView()); if (sFontName.IsEmpty()) return; |