diff options
-rw-r--r-- | basic/source/runtime/methods.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index e91893d76d50..161fa4887d48 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -2461,10 +2461,18 @@ void SbRtl_IsError(StarBASIC *, SbxArray & rPar, bool) SbUnoObject* pObj = dynamic_cast<SbUnoObject*>( pVar ); if ( !pObj ) { + // GetObject() sets error if the variable was not an object, so + // remember and reset if it isn't. + ErrCode eOld = SbxBase::GetError(); if ( SbxBase* pBaseObj = pVar->GetObject() ) { pObj = dynamic_cast<SbUnoObject*>( pBaseObj ); } + else + { + SbxBase::ResetError(); + SbxBase::SetError( eOld ); + } } uno::Reference< script::XErrorQuery > xError; if ( pObj ) |