Index: fpdfsdk/src/javascript/Field.cpp |
diff --git a/fpdfsdk/src/javascript/Field.cpp b/fpdfsdk/src/javascript/Field.cpp |
index 4119b8c32e41e709666da82a8f688a22e1e011bc..39e15e9868bb32fc7671442b8ee0104b6c9a8f3b 100644 |
--- a/fpdfsdk/src/javascript/Field.cpp |
+++ b/fpdfsdk/src/javascript/Field.cpp |
@@ -3397,9 +3397,8 @@ FX_BOOL Field::setFocus(IJS_Context* cc, |
pWidget = pInterForm->GetWidget(pFormField->GetControl(0)); |
} else { |
CPDFDoc_Environment* pEnv = m_pDocument->GetEnv(); |
- ASSERT(pEnv); |
- CPDFXFA_Page* pPage = |
- (CPDFXFA_Page*)pEnv->FFI_GetCurrentPage(m_pDocument->GetDocument()); |
+ UnderlyingPageType* pPage = UnderlyingFromFPDFPage( |
+ pEnv->FFI_GetCurrentPage(m_pDocument->GetUnderlyingDocument())); |
if (!pPage) |
return FALSE; |
if (CPDFSDK_PageView* pCurPageView = m_pDocument->GetPageView(pPage)) { |