diff options
Diffstat (limited to 'core/fpdfdoc/cpvt_generateap.cpp')
-rw-r--r-- | core/fpdfdoc/cpvt_generateap.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/core/fpdfdoc/cpvt_generateap.cpp b/core/fpdfdoc/cpvt_generateap.cpp index 90d5d94f7f..132e771d47 100644 --- a/core/fpdfdoc/cpvt_generateap.cpp +++ b/core/fpdfdoc/cpvt_generateap.cpp @@ -34,9 +34,11 @@ namespace { bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, const int32_t& nWidgetType) { - CPDF_Dictionary* pFormDict = nullptr; - if (CPDF_Dictionary* pRootDict = pDoc->GetRoot()) - pFormDict = pRootDict->GetDictFor("AcroForm"); + const CPDF_Dictionary* pRootDict = pDoc->GetRoot(); + if (!pRootDict) + return false; + + const CPDF_Dictionary* pFormDict = pRootDict->GetDictFor("AcroForm"); if (!pFormDict) return false; |