diff options
author | Tor Lillqvist <tml@collabora.com> | 2018-02-08 19:31:20 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2018-02-09 00:50:02 +0100 |
commit | 73256b918119e378c762f6a3d79d04f311a075cc (patch) | |
tree | 6478f16d9a5e3ad9250a143218c8e539d66c1c99 /basic | |
parent | e0a94ded5d1635fa2a2d9e222bfcfa0a2289a01f (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')
-rw-r--r-- | basic/source/classes/sbxmod.cxx | 5 |
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(); } |