summaryrefslogtreecommitdiff
path: root/basic/source
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2018-02-08 19:31:20 +0200
committerTor Lillqvist <tml@collabora.com>2018-02-09 00:50:02 +0100
commit73256b918119e378c762f6a3d79d04f311a075cc (patch)
tree6478f16d9a5e3ad9250a143218c8e539d66c1c99 /basic/source
parente0a94ded5d1635fa2a2d9e222bfcfa0a2289a01f (diff)
Decrease fragility in odd use cases with no current document
Change-Id: I9966166561d4c6e577f3f7e8e04572f97a0b295e Reviewed-on: https://gerrit.libreoffice.org/49450 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'basic/source')
-rw-r--r--basic/source/classes/sbxmod.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index f0ee0f7f7f56..97fe73dbface 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -409,7 +409,10 @@ uno::Reference< vba::XVBACompatibility > getVBACompatibility( const uno::Referen
bool getDefaultVBAMode( StarBASIC* pb )
{
- uno::Reference< vba::XVBACompatibility > xVBACompat = getVBACompatibility( getDocumentModel( pb ) );
+ uno::Reference< frame::XModel > xModel( getDocumentModel( pb ) );
+ if (!xModel.is())
+ return false;
+ uno::Reference< vba::XVBACompatibility > xVBACompat = getVBACompatibility( xModel );
return xVBACompat.is() && xVBACompat->getVBACompatibilityMode();
}