Check result of GetEventParam() in CJX_Form::recalculate(). All other callers are already checking for a NULL return. Bug: pdfium:1254 Change-Id: I1848554d237c6301d78893931c5f99b1d9aacd1b Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/51730 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/fxjs/xfa/cjx_form.cpp b/fxjs/xfa/cjx_form.cpp index 0a65286..41f7e45 100644 --- a/fxjs/xfa/cjx_form.cpp +++ b/fxjs/xfa/cjx_form.cpp
@@ -82,8 +82,8 @@ const std::vector<v8::Local<v8::Value>>& params) { CXFA_EventParam* pEventParam = GetDocument()->GetScriptContext()->GetEventParam(); - if (pEventParam->m_eType == XFA_EVENT_Calculate || - pEventParam->m_eType == XFA_EVENT_InitCalculate) { + if (pEventParam && (pEventParam->m_eType == XFA_EVENT_Calculate || + pEventParam->m_eType == XFA_EVENT_InitCalculate)) { return CJS_Result::Success(); } if (params.size() != 1)