diff options
-rw-r--r-- | sc/source/core/tool/interpr1.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 6ecf137baafa..12f77a6c7d62 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -242,9 +242,11 @@ void ScInterpreter::ScIfError( bool bNAonly ) { const short* pJump = pCur->GetJump(); short nJumpCount = pJump[ 0 ]; - if (!sp) + if (!sp || nJumpCount != 2) { - PushError( errUnknownStackVariable); + // Reset nGlobalError here to not propagate the old error, if any. + nGlobalError = (sp ? errParameterExpected : errUnknownStackVariable); + PushError( nGlobalError); aCode.Jump( pJump[ nJumpCount ], pJump[ nJumpCount ] ); return; } |