summaryrefslogtreecommitdiff
path: root/core/fpdfapi/font/cpdf_font.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/font/cpdf_font.cpp')
-rw-r--r--core/fpdfapi/font/cpdf_font.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/fpdfapi/font/cpdf_font.cpp b/core/fpdfapi/font/cpdf_font.cpp
index b9be3aa868..53186daec6 100644
--- a/core/fpdfapi/font/cpdf_font.cpp
+++ b/core/fpdfapi/font/cpdf_font.cpp
@@ -61,8 +61,11 @@ CPDF_Font::CPDF_Font()
CPDF_Font::~CPDF_Font() {
if (m_pFontFile) {
- m_pDocument->GetPageData()->MaybePurgeFontFileStreamAcc(
- m_pFontFile->GetStream()->AsStream());
+ auto* pPageData = m_pDocument->GetPageData();
+ if (pPageData) {
+ pPageData->MaybePurgeFontFileStreamAcc(
+ m_pFontFile->GetStream()->AsStream());
+ }
}
}