summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorBo Xu <bo_xu@foxitsoftware.com>2014-07-09 10:56:52 -0700
committerBo Xu <bo_xu@foxitsoftware.com>2014-07-09 10:56:52 -0700
commitd573678115676fc06575d6dac0801a3532cf0216 (patch)
treee71896de920d24cc6d5ef584af646d524511afbf /core
parentcb46ea1bca55b448a7a54db2086c6f736f05c35f (diff)
downloadpdfium-d573678115676fc06575d6dac0801a3532cf0216.tar.xz
Fix a null object check
BUG=390615 R=thakis@chromium.org Review URL: https://codereview.chromium.org/378293005
Diffstat (limited to 'core')
-rw-r--r--core/src/fpdfdoc/doc_basic.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/src/fpdfdoc/doc_basic.cpp b/core/src/fpdfdoc/doc_basic.cpp
index 25f641c52e..5ccf4ceee9 100644
--- a/core/src/fpdfdoc/doc_basic.cpp
+++ b/core/src/fpdfdoc/doc_basic.cpp
@@ -46,7 +46,9 @@ int CPDF_Dest::GetZoomMode()
if (m_pObj == NULL || m_pObj->GetType() != PDFOBJ_ARRAY) {
return 0;
}
- CFX_ByteString mode = ((CPDF_Array*)m_pObj)->GetElementValue(1)->GetString();
+ CFX_ByteString mode;
+ CPDF_Object* pObj = ((CPDF_Array*)m_pObj)->GetElementValue(1);
+ mode = pObj ? pObj->GetString() : CFX_ByteString();
int i = 0;
while (g_sZoomModes[i][0] != '\0') {
if (mode == g_sZoomModes[i]) {