summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-12-05 17:26:35 +0100
committerEike Rathke <erack@redhat.com>2017-12-05 21:19:51 +0100
commit6900730a61de8c55af7157b072a42a7742ccddb3 (patch)
tree3c172cc515b21e7a8bb9a2988446ede44262a957 /basic
parent11667a8df2e4aad7c14c1ef3fdb80f61515832fc (diff)
Resolves: tdf#114232 call GetObject() only if IsObject()
This is a combination of 2 commits. Resolves: tdf#114232 reset error after unsuccessful GetObject() query Probably broken already since commit 0b21b8b146fc4b982c7c9bbb866b9ff18a29332a Date: Wed Oct 6 10:16:27 2010 +0100 initial commit for vba blob ( not including container_control stuff ) Change-Id: Iecce564851a76921b491ff101365c70883ad7475 (cherry picked from commit 863e269cd3d37034e634d9ad730d8e87a46ceb76) Rather call GetObject() only if IsObject(), tdf#112571 follow-up Which effectively is what GetObject() internally also does to determine whether to set an error, so resetting an error here is moot (or might even hide a nested error?). Change-Id: I8736d16e386d1833126965538f96aaa1fd73dfd6 (cherry picked from commit d1cd68fac3a3a521e1f7ebf033b908d67832a0c1) Reviewed-on: https://gerrit.libreoffice.org/45904 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'basic')
-rw-r--r--basic/source/runtime/methods.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index e91893d76d50..4a5aaa39a98b 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -2461,7 +2461,7 @@ void SbRtl_IsError(StarBASIC *, SbxArray & rPar, bool)
SbUnoObject* pObj = dynamic_cast<SbUnoObject*>( pVar );
if ( !pObj )
{
- if ( SbxBase* pBaseObj = pVar->GetObject() )
+ if ( SbxBase* pBaseObj = (pVar->IsObject() ? pVar->GetObject() : nullptr) )
{
pObj = dynamic_cast<SbUnoObject*>( pBaseObj );
}