From d573678115676fc06575d6dac0801a3532cf0216 Mon Sep 17 00:00:00 2001 From: Bo Xu Date: Wed, 9 Jul 2014 10:56:52 -0700 Subject: Fix a null object check BUG=390615 R=thakis@chromium.org Review URL: https://codereview.chromium.org/378293005 --- core/src/fpdfdoc/doc_basic.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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]) { -- cgit v1.2.3