summaryrefslogtreecommitdiff
path: root/sc/source/core
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-23 09:19:32 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-04-23 10:19:15 +0200
commit4faf8ef2553aba31d6021abce604f7716d2ad229 (patch)
tree1968f77f14de5ddefa0c74c6bb5ebb0b57a4a3bd /sc/source/core
parent6454b6336b8de9a4c5899adeab552af6f794cdc4 (diff)
tdf#132278 crash after opening an old file
regression from commit 7282014e362a1529a36c88eb308df8ed359c2cfa tdf#50916 Makes numbers of columns dynamic. Change-Id: I7a37631094b91f4859326db054f285daa8dccbb8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92740 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/core')
-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;
}