diff options
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/documen4.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx index 608cf4d0dd48..53c90db8494d 100644 --- a/sc/source/core/data/documen4.cxx +++ b/sc/source/core/data/documen4.cxx @@ -284,7 +284,12 @@ void ScDocument::InsertMatrixFormula(SCCOL nCol1, SCROW nRow1, continue; if (*itr == nTab1) - maTabs[*itr]->SetFormulaCell(nCol1, nRow1, pCell); + { + pCell = maTabs[*itr]->SetFormulaCell(nCol1, nRow1, pCell); + assert(pCell); //NULL if nCol1/nRow1 is invalid, which it can't be here + if (!pCell) + break; + } else maTabs[*itr]->SetFormulaCell( nCol1, nRow1, |