summaryrefslogtreecommitdiff
path: root/xfa/src/fxfa/src/parser/xfa_script_nodehelper.cpp
diff options
context:
space:
mode:
authorJun Fang <jun_fang@foxitsoftware.com>2016-02-06 09:51:38 +0800
committerJun Fang <jun_fang@foxitsoftware.com>2016-02-06 09:51:38 +0800
commit2f6ed155a5cd0938cd298bf30b9ca28e610843ba (patch)
tree410427489c36e6a9a1471192dbf7f03c113cde61 /xfa/src/fxfa/src/parser/xfa_script_nodehelper.cpp
parent2a1f9736c2e459a9abec00853f0bff21a87e31d4 (diff)
downloadpdfium-2f6ed155a5cd0938cd298bf30b9ca28e610843ba.tar.xz
Add a parameter checker in CXFA_ScriptContext::QueryNodeByFlag()
BUG=pdfium:380 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1674453004 .
Diffstat (limited to 'xfa/src/fxfa/src/parser/xfa_script_nodehelper.cpp')
-rw-r--r--xfa/src/fxfa/src/parser/xfa_script_nodehelper.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/xfa/src/fxfa/src/parser/xfa_script_nodehelper.cpp b/xfa/src/fxfa/src/parser/xfa_script_nodehelper.cpp
index 8fe9348b51..7ef7382f69 100644
--- a/xfa/src/fxfa/src/parser/xfa_script_nodehelper.cpp
+++ b/xfa/src/fxfa/src/parser/xfa_script_nodehelper.cpp
@@ -43,11 +43,12 @@ int32_t CXFA_NodeHelper::XFA_CountSiblings(CXFA_Node* pNode,
XFA_LOGIC_TYPE eLogicType,
CXFA_NodeArray* pSiblings,
FX_BOOL bIsClassName) {
+ if (!pNode)
+ return 0;
CXFA_Node* parent =
XFA_ResolveNodes_GetParent(pNode, XFA_LOGIC_NoTransparent);
- if (parent == NULL) {
+ if (!parent)
return 0;
- }
XFA_LPCPROPERTY pPropert = XFA_GetPropertyOfElement(
parent->GetClassID(), pNode->GetClassID(), XFA_XDPPACKET_UNKNOWN);
if (!pPropert && eLogicType == XFA_LOGIC_Transparent) {