From 3f3c39d04fd68d8ce11f52baa3acae8e0522a2c4 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 1 May 2018 17:46:34 +0000 Subject: Check for NULL XFA context even when XFA Use strict typing for FPDF_Page to ensure we don't fall into code that expects the other page type when continuing from null context case. Change-Id: I7f028ef3e3d733f5557620030a87e22997da00d5 Reviewed-on: https://pdfium-review.googlesource.com/31770 Commit-Queue: Tom Sepez Reviewed-by: dsinclair --- testing/xfa_js_embedder_test.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'testing/xfa_js_embedder_test.cpp') diff --git a/testing/xfa_js_embedder_test.cpp b/testing/xfa_js_embedder_test.cpp index 375497f9ea..fe54621a2b 100644 --- a/testing/xfa_js_embedder_test.cpp +++ b/testing/xfa_js_embedder_test.cpp @@ -45,7 +45,13 @@ void XFAJSEmbedderTest::TearDown() { CXFA_Document* XFAJSEmbedderTest::GetXFADocument() { auto* pDoc = CPDFDocumentFromFPDFDocument(document()); + if (!pDoc) + return nullptr; + auto* pContext = static_cast(pDoc->GetExtension()); + if (!pContext) + return nullptr; + return pContext->GetXFADoc()->GetXFADoc(); } -- cgit v1.2.3