summaryrefslogtreecommitdiff
path: root/sc/source/core/tool/interpr4.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-02-23 15:24:27 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-02-23 15:29:32 +0000
commit7db1dbaa70b4b1ef52d66215e15fc44c9650ef1f (patch)
treeb94b8ecd3834b1945eccf0f2e123fe69c8642dd3 /sc/source/core/tool/interpr4.cxx
parent1cd5a550073411ea85a1eeaaa4acf1f2ee64f586 (diff)
coverity#706831 Uncaught exception
also coverity#706839 Uncaught exception coverity#706840 Uncaught exception and probably a gadzillion more Change-Id: I3c3ceebb259cccc9c41f5a49bd0c95b151dd7c58
Diffstat (limited to 'sc/source/core/tool/interpr4.cxx')
-rw-r--r--sc/source/core/tool/interpr4.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 114ffb84f0a7..135b01c941b7 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -3150,8 +3150,18 @@ void ScInterpreter::ScMacro()
// Funktion ueber den einfachen Namen suchen,
// dann aBasicStr, aMacroStr fuer SfxObjectShell::CallBasic zusammenbauen
- StarBASIC* pRoot = pDocSh->GetBasic();
- SbxVariable* pVar = pRoot->Find( aMacro, SbxCLASS_METHOD );
+ StarBASIC* pRoot;
+
+ try
+ {
+ pRoot = pDocSh->GetBasic();
+ }
+ catch (...)
+ {
+ pRoot = NULL;
+ }
+
+ SbxVariable* pVar = pRoot ? pRoot->Find(aMacro, SbxCLASS_METHOD) : NULL;
if( !pVar || pVar->GetType() == SbxVOID || !pVar->ISA(SbMethod) )
{
PushError( errNoMacro );