diff options
-rw-r--r-- | sc/source/core/tool/interpr4.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index c3992053ce3a..5a36165810e4 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -1286,6 +1286,8 @@ ScDBRangeBase* ScInterpreter::PopDBDoubleRef() pMat = PopMatrix(); else PopExternalDoubleRef(pMat); + if (nGlobalError) + break; return new ScDBExternalRange(pDok, pMat); } default: @@ -1542,7 +1544,14 @@ void ScInterpreter::PopExternalDoubleRef(ScMatrixRef& rMat) // references, which means the array should only contain a // single matrix token. ScToken* p = static_cast<ScToken*>(pArray->First()); - rMat = p->GetMatrix(); + if (!p || p->GetType() != svMatrix) + SetError( errIllegalParameter); + else + { + rMat = p->GetMatrix(); + if (!rMat) + SetError( errUnknownVariable); + } } void ScInterpreter::GetExternalDoubleRef( |