summaryrefslogtreecommitdiff
path: root/testing/xfa_js_embedder_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'testing/xfa_js_embedder_test.cpp')
-rw-r--r--testing/xfa_js_embedder_test.cpp6
1 files changed, 6 insertions, 0 deletions
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<CPDFXFA_Context*>(pDoc->GetExtension());
+ if (!pContext)
+ return nullptr;
+
return pContext->GetXFADoc()->GetXFADoc();
}