summaryrefslogtreecommitdiff
path: root/xfa/src
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/src')
-rw-r--r--xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp b/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp
index 262a0be717..f83b772003 100644
--- a/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp
+++ b/xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp
@@ -603,10 +603,9 @@ int32_t CXFA_LayoutPageMgr::GetPageCount() const {
return m_PageArray.GetSize();
}
IXFA_LayoutPage* CXFA_LayoutPageMgr::GetPage(int32_t index) const {
- if (m_PageArray.GetSize() > index) {
- return m_PageArray[index];
- }
- return NULL;
+ if (index < 0 || index >= m_PageArray.GetSize())
+ return nullptr;
+ return m_PageArray[index];
}
int32_t CXFA_LayoutPageMgr::GetPageIndex(const IXFA_LayoutPage* pPage) const {
// FIXME: Find() method should take const.