commit | f15af61d9d2a8213cf9d8cddfe9374b85a8e9a83 | [log] [tgz] |
---|---|---|
author | Lei Zhang <thestig@chromium.org> | Tue Nov 02 01:10:43 2021 +0000 |
committer | Pdfium LUCI CQ <pdfium-scoped@luci-project-accounts.iam.gserviceaccount.com> | Tue Nov 02 01:10:43 2021 +0000 |
tree | cc8f91e8ef7cab104b0343d06dce4e9373312a06 | |
parent | 5565257bbf3b6d724150297be0c3291596a86c80 [diff] |
Remove a nullptr check in CXFA_FFDoc::BuildDoc(). Replace it with a DCHECK(). Also add a DCHECK() in CXFA_DocumentBuilder::BuildDocument() in the same call stack. Change-Id: Iab4256570089c5ed0b77f234ce8a1d977abbf091 Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/86634 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/xfa/fxfa/cxfa_ffdoc.cpp b/xfa/fxfa/cxfa_ffdoc.cpp index 1bec0e7..4838e10 100644 --- a/xfa/fxfa/cxfa_ffdoc.cpp +++ b/xfa/fxfa/cxfa_ffdoc.cpp
@@ -90,8 +90,7 @@ } bool CXFA_FFDoc::BuildDoc(CFX_XMLDocument* pXML) { - if (!pXML) - return false; + DCHECK(pXML); CXFA_DocumentBuilder builder(m_pDocument); if (!builder.BuildDocument(pXML, XFA_PacketType::Xdp))
diff --git a/xfa/fxfa/parser/cxfa_document_builder.cpp b/xfa/fxfa/parser/cxfa_document_builder.cpp index ce46d74..05fa2a7 100644 --- a/xfa/fxfa/parser/cxfa_document_builder.cpp +++ b/xfa/fxfa/parser/cxfa_document_builder.cpp
@@ -232,6 +232,8 @@ bool CXFA_DocumentBuilder::BuildDocument(CFX_XMLDocument* pXML, XFA_PacketType ePacketID) { + DCHECK(pXML); + CFX_XMLNode* root = Build(pXML); if (!root) return false;