From 54f86140d436ce2f457dc588f5b2c183d4e94452 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Wed, 10 Jan 2018 17:03:35 +0000 Subject: Verify GetOrCreate results are checked This CL updates users of the GetOrCreate* methods to verify that the value returned is not null before accessing. Change-Id: I4a9fd29a26d5e4ec792ca3671c9868828e53d46e Reviewed-on: https://pdfium-review.googlesource.com/22652 Reviewed-by: Ryan Harrison Commit-Queue: dsinclair --- fxjs/xfa/cjx_node.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'fxjs/xfa') diff --git a/fxjs/xfa/cjx_node.cpp b/fxjs/xfa/cjx_node.cpp index e8fa44eb17..cf2642c8ad 100644 --- a/fxjs/xfa/cjx_node.cpp +++ b/fxjs/xfa/cjx_node.cpp @@ -165,6 +165,9 @@ CJS_Return CJX_Node::getElement( CXFA_Node* pNode = GetOrCreateProperty( iValue, CXFA_Node::NameToElement(expression)); + if (!pNode) + return CJS_Return(runtime->NewNull()); + CFXJSE_Value* value = GetDocument()->GetScriptContext()->GetJSValueFromMap(pNode); if (!value) -- cgit v1.2.3