summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-10-05 19:17:23 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-05 19:17:23 +0000
commitbe4e055bce62c9af26461f435704b9aa086f6fc4 (patch)
tree66fb7cf7f7c9c90134324970e90fa82ace438ac5
parent9934cc2f2f1a6382269d0d2da6886113bfb2c309 (diff)
downloadpdfium-be4e055bce62c9af26461f435704b9aa086f6fc4.tar.xz
Remove unreachable null checks in CPDF_ActionFields
We always pass &local as the argument to the ctor. Change-Id: I3d6e046b8aed0a2cee3c3c20513e72b85741cabe Reviewed-on: https://pdfium-review.googlesource.com/c/43550 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
-rw-r--r--core/fpdfdoc/cpdf_actionfields.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/core/fpdfdoc/cpdf_actionfields.cpp b/core/fpdfdoc/cpdf_actionfields.cpp
index 2af70c2be5..4db5bc543b 100644
--- a/core/fpdfdoc/cpdf_actionfields.cpp
+++ b/core/fpdfdoc/cpdf_actionfields.cpp
@@ -11,15 +11,14 @@
#include "core/fpdfdoc/cpdf_action.h"
CPDF_ActionFields::CPDF_ActionFields(const CPDF_Action* pAction)
- : m_pAction(pAction) {}
+ : m_pAction(pAction) {
+ ASSERT(m_pAction);
+}
CPDF_ActionFields::~CPDF_ActionFields() = default;
std::vector<const CPDF_Object*> CPDF_ActionFields::GetAllFields() const {
std::vector<const CPDF_Object*> fields;
- if (!m_pAction)
- return fields;
-
const CPDF_Dictionary* pDict = m_pAction->GetDict();
if (!pDict)
return fields;
@@ -47,9 +46,6 @@ std::vector<const CPDF_Object*> CPDF_ActionFields::GetAllFields() const {
}
const CPDF_Object* CPDF_ActionFields::GetField(size_t iIndex) const {
- if (!m_pAction)
- return nullptr;
-
const CPDF_Dictionary* pDict = m_pAction->GetDict();
if (!pDict)
return nullptr;