From 19835921655cd6f2086c7a741696906fc340abac Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 11 Jan 2018 14:34:56 +0000 Subject: Rename GetFormValue to GetFormValueIfExists This CL makes it clear that GetFormValue can return nullptr and fixes up a few callsites as needed. Change-Id: Id2e85b0956a678b5b338b9e2a4d32731fe6c4729 Reviewed-on: https://pdfium-review.googlesource.com/22690 Reviewed-by: Ryan Harrison Commit-Queue: dsinclair --- fxjs/xfa/cjx_field.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'fxjs/xfa') diff --git a/fxjs/xfa/cjx_field.cpp b/fxjs/xfa/cjx_field.cpp index 0007bad592..299c6ef3a4 100644 --- a/fxjs/xfa/cjx_field.cpp +++ b/fxjs/xfa/cjx_field.cpp @@ -272,7 +272,8 @@ void CJX_Field::defaultValue(CFXJSE_Value* pValue, } CXFA_Node* pUIChild = pWidgetAcc->GetUIChild(); - CXFA_Node* pNode = xfaNode->GetFormValue()->GetFirstChild(); + CXFA_Node* formValue = xfaNode->GetFormValueIfExists(); + CXFA_Node* pNode = formValue ? formValue->GetFirstChild() : nullptr; if (pNode && pNode->GetElementType() == XFA_Element::Decimal) { if (pUIChild->GetElementType() == XFA_Element::NumericEdit && (pNode->JSObject()->GetInteger(XFA_Attribute::FracDigits) == -1)) { -- cgit v1.2.3