summaryrefslogtreecommitdiff
path: root/core/src/fpdfdoc/doc_basic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/fpdfdoc/doc_basic.cpp')
-rw-r--r--core/src/fpdfdoc/doc_basic.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/src/fpdfdoc/doc_basic.cpp b/core/src/fpdfdoc/doc_basic.cpp
index 199a9a6dec..25f641c52e 100644
--- a/core/src/fpdfdoc/doc_basic.cpp
+++ b/core/src/fpdfdoc/doc_basic.cpp
@@ -72,7 +72,10 @@ CFX_ByteString CPDF_Dest::GetRemoteName()
}
CPDF_NameTree::CPDF_NameTree(CPDF_Document* pDoc, FX_BSTR category)
{
- m_pRoot = pDoc->GetRoot()->GetDict(FX_BSTRC("Names"))->GetDict(category);
+ if (pDoc->GetRoot() && pDoc->GetRoot()->GetDict(FX_BSTRC("Names")))
+ m_pRoot = pDoc->GetRoot()->GetDict(FX_BSTRC("Names"))->GetDict(category);
+ else
+ m_pRoot = NULL;
}
static CPDF_Object* SearchNameNode(CPDF_Dictionary* pNode, const CFX_ByteString& csName,
int& nIndex, CPDF_Array** ppFind, int nLevel = 0)