summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/core/data/dociter.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx
index 85be65c5c17d..eb110991140a 100644
--- a/sc/source/core/data/dociter.cxx
+++ b/sc/source/core/data/dociter.cxx
@@ -325,7 +325,8 @@ const sc::CellStoreType* ScDBQueryDataIterator::GetColumnCellStore(ScDocument& r
ScTable* pTab = rDoc.FetchTable(nTab);
if (!pTab)
return nullptr;
-
+ if (nCol >= pTab->GetAllocatedColumnsCount())
+ return nullptr;
return &pTab->aCol[nCol].maCells;
}